simon-git: puzzles (main): Ben Harris
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Jan 19 20:50:57 GMT 2023
TL;DR:
1d509dc js: Have the "SoftRight" key open the menu by focussing it
241f68b Properly-styled icons for KaiOS
f9449af kaios: Major parts of a build for KaiOS
f693794 js: Make soft-key labels generate key events when clicked
e5604cc js: Rename update_undo_redo() as post_move()
420663d js: Use current_key_label() to label feature phone softkeys
9d7b044 js: Simpler and more robust startup procedure
48ded12 js: Look up elements in the DOM as early as possible
5ba1bf5 js: Tolerate the absence of various UI elements from the HTML
81b6bcc js: Remove an outdated reference to the "invisible Custom option"
1eba638 kaios: Hack out everything that needs dialogue boxes
cc2e94a kaios: Put version numbers in manifest files
eb60f00 Buildscr bits for making KaiOS builds
fb13ce8 kaios: Turn off :hover highlighting in menus
2a4abce kaios: Provide a populated "locales" field in the manifest
87f21b2 Generate a possibly suitable marketing banner for the KaiStore
aac72f2 Deliver banner images from build script
b6f783e Correct type of "locales" in KaiOS manifest
b8e9bfa kaios: Make F10 open and close the menu
b0203e8 js: Quicker keyboard access to menu items
860d79c kaios: Add hooks for the KaiAds API
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: 2023-01-19 20:50:57
commit 1d509dc81961f182629bf0bfd48eed7941122fab
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1d509dc81961f182629bf0bfd48eed7941122fab;hp=27c97c0ffdda0b91fecf155f3bc29b32ed806bb2
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Tue Nov 15 01:08:08 2022 +0000
js: Have the "SoftRight" key open the menu by focussing it
emccpre.js | 11 +++++++++++
1 file changed, 11 insertions(+)
commit 241f68b543de62a800ff5cbf6c06580d45ab8a13
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=241f68b543de62a800ff5cbf6c06580d45ab8a13;hp=1d509dc81961f182629bf0bfd48eed7941122fab
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sat Dec 10 21:46:34 2022 +0000
Properly-styled icons for KaiOS
These are built alongside other icons as part of the GTK build. It
builds new icon sizes of 44 and 88 pixels and then uses ImageMagick to
round off the corners and add a shadow in accordance with the KaiOS
design guide.
icons/icons.cmake | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
commit f9449af87a4f5420aa7683d3f15110bfa2f1bf17
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=f9449af87a4f5420aa7683d3f15110bfa2f1bf17;hp=241f68b543de62a800ff5cbf6c06580d45ab8a13
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sat Oct 29 18:22:35 2022 +0100
kaios: Major parts of a build for KaiOS
KaiOS (which is based on Firefox OS, formerly Boot to Gecko) runs its
"native" apps in a Web browser, so this is essentially a rather
specialised version of the JavaScript front-end. Indeed, the JavaScript
and C parts are the same as the Web version.
There are three major parts that are specific to the KaiOS build.
First, there's manifest.pl, which generates a KaiOS-specific JSON
manifest describing each puzzle.
Second, there's a new HTML page generator, apppage.pl, that generates an
HTML page that is much less like a Web page, and much more like an
application, than the one generated by jspage.pl. It expects to build a
single HTML page at a time and gets all its limited knowledge of the
environment from its command line. This makes it gratuitously different
from jspage.pl and javapage.pl, but makes it easier to run from the
build system.
And finally, there's the CMake glue that assembles the necessary parts
for each application in a directory. This includes the manifest, the
HTML, the JavaScript, the KaiOS-specific icons (generated as part of the
GTK build) and a copy of the HTML documentation. The directory is
assembled using CMake's install() function, and can be installed on a
KaiOS device using the developer tools.
cmake/platforms/emscripten.cmake | 67 ++++++++
emccpre.js | 10 +-
kaios/apppage.pl | 337 +++++++++++++++++++++++++++++++++++++++
kaios/manifest.pl | 36 +++++
4 files changed, 449 insertions(+), 1 deletion(-)
commit f693794ff543cb0765ca115d76376bad8e2f5190
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=f693794ff543cb0765ca115d76376bad8e2f5190;hp=f9449af87a4f5420aa7683d3f15110bfa2f1bf17
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sat Nov 26 23:08:31 2022 +0000
js: Make soft-key labels generate key events when clicked
This makes the app page a little easier to test on desktop browsers that
don't have SoftLeft and SoftRight keys.
emccpre.js | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
commit e5604ccf374f5f586bd933413d33fac8b26a16d5
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=e5604ccf374f5f586bd933413d33fac8b26a16d5;hp=f693794ff543cb0765ca115d76376bad8e2f5190
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Mon Dec 5 01:14:18 2022 +0000
js: Rename update_undo_redo() as post_move()
I want to do more things with it.
emcc.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
commit 420663d47790a7e34a1662d679a0c00efdb5b7e5
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=420663d47790a7e34a1662d679a0c00efdb5b7e5;hp=e5604ccf374f5f586bd933413d33fac8b26a16d5
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Mon Dec 5 01:16:16 2022 +0000
js: Use current_key_label() to label feature phone softkeys
emcc.c | 3 +++
emcclib.js | 15 +++++++++++++++
kaios/apppage.pl | 4 +++-
3 files changed, 21 insertions(+), 1 deletion(-)
commit 9d7b044c01680e408094d3bae82f622ae8a5b48b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=9d7b044c01680e408094d3bae82f622ae8a5b48b;hp=420663d47790a7e34a1662d679a0c00efdb5b7e5
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Fri Dec 9 13:56:12 2022 +0000
js: Simpler and more robust startup procedure
Previously, we initialised all of the JavaScript event handlers as soon
at the DOM was loaded, and then called main() ourselves once the
Emscripten runtime was ready. This was slightly dangerous since it
depended on none of those event handlers' being called before main().
In practice this was difficult because most of the elements the event
handlers were attached to were invisible, but it did limit what event
handlers could safely be used.
Now, the event handlers are initialised from main(). This makes things
work in a sufficiently conventional way that we can just let the
Emscripten run-time call main() in its usual way, rather than involving
ourselves in the minutiae of Emscripten's startup.
cmake/platforms/emscripten.cmake | 3 +-
emcc.c | 12 ++++
emcclib.js | 17 +++++
emccpost.js | 1 -
emccpre.js | 130 +++++++++++++++++----------------------
5 files changed, 88 insertions(+), 75 deletions(-)
commit 48ded126a9fd399cf2d9c66ee928f4d1d6d065e4
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=48ded126a9fd399cf2d9c66ee928f4d1d6d065e4;hp=9d7b044c01680e408094d3bae82f622ae8a5b48b
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 11:53:17 2022 +0000
js: Look up elements in the DOM as early as possible
Now that our script is loaded using <script defer>, we can rely on the
DOM's being complete as soon as it starts running. So when we declare a
variable to point to a DOM element, we can initialise it with that
element. This saves having these odd initialisations scattered around
the code, usually but not always at the site of first use.
I'd like to be able to do the same thing with the variables that point
to C functions, but the Module.cwrap() call isn't entirely safe before
Emscripten has finished loading the C code.
emccpre.js | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
commit 5ba1bf55600443ca6cdad448aa629ffbce7c4e22
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=5ba1bf55600443ca6cdad448aa629ffbce7c4e22;hp=48ded126a9fd399cf2d9c66ee928f4d1d6d065e4
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 12:17:54 2022 +0000
js: Tolerate the absence of various UI elements from the HTML
To make things more consistent, the static buttons now all have their
own variables.
emcclib.js | 12 +++++++-----
emccpre.js | 27 +++++++++++++++++----------
2 files changed, 24 insertions(+), 15 deletions(-)
commit 81b6bccab601ff1c08c8f8306d83bd24677d9d6c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=81b6bccab601ff1c08c8f8306d83bd24677d9d6c;hp=5ba1bf55600443ca6cdad448aa629ffbce7c4e22
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 12:25:11 2022 +0000
js: Remove an outdated reference to the "invisible Custom option"
emcc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
commit 1eba6388bfed72e21a4525ef7a1c6c18d857b703
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1eba6388bfed72e21a4525ef7a1c6c18d857b703;hp=81b6bccab601ff1c08c8f8306d83bd24677d9d6c
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 13:05:16 2022 +0000
kaios: Hack out everything that needs dialogue boxes
They're proving to be a right nuisance and will probably require a
substantial overhaul to how they work across the entire JavaScript
front-end. I don't think any of the functionality provided by the
dialogue boxes is critical, so in the interests of getting a minimum
viable product actually released I've disabled those features.
In most cases, this just involves commenting out bits of HTML. The
"Custom..." menu item is added by C code, though, so there I've fallen
back to the standard Puzzles way to implement a nasty hack: an
environment variable.
emcc.c | 10 +++++++++-
kaios/apppage.pl | 5 ++++-
2 files changed, 13 insertions(+), 2 deletions(-)
commit cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab;hp=1eba6388bfed72e21a4525ef7a1c6c18d857b703
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 14:08:12 2022 +0000
kaios: Put version numbers in manifest files
This only happens if something edits manifest.pl to provide a version
number, but Buildscr can do that. KaiOS manifests are documented as
requiring dotted-decimal version numbers. In fact, the restrictions are
much stricter than that, and unacceptable version numbers can break the
KaiStore developer portal. YY.MM.DD version numbers seem to be
acceptable.
kaios/manifest.pl | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
commit eb60f001b7053022539c2737b5c2106c8798bde5
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=eb60f001b7053022539c2737b5c2106c8798bde5;hp=cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 14:10:16 2022 +0000
Buildscr bits for making KaiOS builds
These are currently treated as just another JavaScript build, so they
don't have their own variable to turn them off.
Buildscr | 8 ++++++++
1 file changed, 8 insertions(+)
commit fb13ce8d716cb2b24208e5a48aa704ef50f98697
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=fb13ce8d716cb2b24208e5a48aa704ef50f98697;hp=eb60f001b7053022539c2737b5c2106c8798bde5
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 14:11:32 2022 +0000
kaios: Turn off :hover highlighting in menus
Even when the virtual pointer is hidden in KaiOS, it still causes :hover
on whatever element is nominally under it, which is confusing. Disable
all the :hover effects as a workaround.
kaios/apppage.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 2a4abce8a8ae957df4e3cbe2d6fc78d6ff10d69b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=2a4abce8a8ae957df4e3cbe2d6fc78d6ff10d69b;hp=fb13ce8d716cb2b24208e5a48aa704ef50f98697
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Dec 11 15:01:34 2022 +0000
kaios: Provide a populated "locales" field in the manifest
The documentation says it's only needed to override values in the main
manifest, but it's apparently required even if you only support one
locale.
kaios/manifest.pl | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
commit 87f21b2de436477e5d92cfe9850583296a88a90c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=87f21b2de436477e5d92cfe9850583296a88a90c;hp=2a4abce8a8ae957df4e3cbe2d6fc78d6ff10d69b
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Mon Dec 19 14:23:02 2022 +0000
Generate a possibly suitable marketing banner for the KaiStore
It wants a 240x130 pixel JPEG. I've gone for rotating the screenshot
a bit because the store overlays text on the picture and I don't want
horizontal lines in the picture confusing the text. I think the store
handles dimming the image, so the picture we produce is at full
brightness.
icons/icons.cmake | 11 +++++++++++
1 file changed, 11 insertions(+)
commit aac72f2cd8e10c7faef3060fcf14201f958a6fe8
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=aac72f2cd8e10c7faef3060fcf14201f958a6fe8;hp=87f21b2de436477e5d92cfe9850583296a88a90c
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Mon Dec 19 23:29:39 2022 +0000
Deliver banner images from build script
Buildscr | 3 +++
1 file changed, 3 insertions(+)
commit b6f783e26e9d692dc2243bf5cf945cc0717c00aa
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=b6f783e26e9d692dc2243bf5cf945cc0717c00aa;hp=aac72f2cd8e10c7faef3060fcf14201f958a6fe8
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sat Dec 31 16:04:29 2022 +0000
Correct type of "locales" in KaiOS manifest
It should be an object, not an array.
kaios/manifest.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit b8e9bfa7f6a1d96e8cae96f43d7b5a1394abb447
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=b8e9bfa7f6a1d96e8cae96f43d7b5a1394abb447;hp=b6f783e26e9d692dc2243bf5cf945cc0717c00aa
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Sun Jan 1 23:29:25 2023 +0000
kaios: Make F10 open and close the menu
This is no use on KaiOS itself, but provides a way to open the menu from
the keyboard on desktop browsers for testing (and for
keyboard-accessibility in general).
emccpre.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
commit b0203e8f72df74783a5e216aa7cd1a8f307a4d41
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=b0203e8f72df74783a5e216aa7cd1a8f307a4d41;hp=b8e9bfa7f6a1d96e8cae96f43d7b5a1394abb447
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Mon Jan 2 00:16:07 2023 +0000
js: Quicker keyboard access to menu items
Now pressing "1" to "9" or "0" activate the first ten items of the
current menu, to save so much pressing of the arrow keys. There isn't
any visible indication of this, so it's a bit of an Easter egg.
emccpre.js | 45 +++++++++++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 16 deletions(-)
commit 860d79c874db624f94b0210d6ed6de1055712fe2
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=860d79c874db624f94b0210d6ed6de1055712fe2;hp=b0203e8f72df74783a5e216aa7cd1a8f307a4d41
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Thu Jan 5 21:20:19 2023 +0000
kaios: Add hooks for the KaiAds API
The Kai Store makes display of advertisements provided by the KaiAds API
mandatory. I don't want such adverts to be inconvenient for the users,
so I've just gone for adding a menu item that will display one. This is
probably a little too crude, but it's good for testing things.
The actual KaiAds API code is not free software, so it's not included
here. My intention is to add it by hand to the Zip files for Kai Store
uploads. Without it, the advertising code does nothing.
cmake/platforms/emscripten.cmake | 2 ++
kaios/apppage.pl | 3 +++
kaios/kaiads-glue.js | 58 ++++++++++++++++++++++++++++++++++++++++
kaios/manifest.pl | 10 +++++++
4 files changed, 73 insertions(+)
More information about the tartarus-commits
mailing list