From f2ce65585d77bf6e38630e67ea308f7a540456d0 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sat, 10 May 2025 13:03:00 -0700 Subject: [PATCH] Adding missed file, add password prompt and instructions. --- attic/jotblk/.gcloudignore | 19 +++++++++++++++++++ attic/jotblk/README.md | 2 ++ attic/jotblk/static/jotblk.js | 28 ++++++++++++++++++---------- 3 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 attic/jotblk/.gcloudignore diff --git a/attic/jotblk/.gcloudignore b/attic/jotblk/.gcloudignore new file mode 100644 index 0000000..603f0b6 --- /dev/null +++ b/attic/jotblk/.gcloudignore @@ -0,0 +1,19 @@ +# This file specifies files that are *not* uploaded to Google Cloud +# using gcloud. It follows the same syntax as .gitignore, with the addition of +# "#!include" directives (which insert the entries of the given .gitignore-style +# file at that point). +# +# For more information, run: +# $ gcloud topic gcloudignore +# +.gcloudignore +# If you would like to upload your .git directory, .gitignore file or files +# from your .gitignore file, remove the corresponding line +# below: +.git +.gitignore + +# Python pycache: +__pycache__/ +# Ignored by the build system +/setup.cfg \ No newline at end of file diff --git a/attic/jotblk/README.md b/attic/jotblk/README.md index bcf92f5..3aa3560 100644 --- a/attic/jotblk/README.md +++ b/attic/jotblk/README.md @@ -18,3 +18,5 @@ And separately (to run a webserver on http://localhost:8080): ``` ./run.sh ``` + +Before use, type password. Default is: xyzzy diff --git a/attic/jotblk/static/jotblk.js b/attic/jotblk/static/jotblk.js index 708a897..2b36bf9 100644 --- a/attic/jotblk/static/jotblk.js +++ b/attic/jotblk/static/jotblk.js @@ -184,11 +184,15 @@ function Update() { ctx.textBaseline = 'middle'; ctx.save(); ctx.scale(canvas.width / 64 , canvas.height / 17); - for (var j = 0; j < 16; ++j) { - for (var i = 0; i < 64; ++i) { - if (pos === i + j * 64) { - ctx.fillStyle = '#750'; - ctx.fillRect(i, j, 1, 1); + ctx.fillStyle = '#750'; + if (window.onkeydown === Login) { + ctx.fillRect(10, 0, 1, 1); + } else { + for (var j = 0; j < 16; ++j) { + for (var i = 0; i < 64; ++i) { + if (pos === i + j * 64) { + ctx.fillRect(i, j, 1, 1); + } } } } @@ -197,11 +201,15 @@ function Update() { var w = m.width; var h = m.fontBoundingBoxAscent + m.fontBoundingBoxDescent; ctx.scale(1 / w, 1 / h); - for (var j = 0; j < 16; ++j) { - for (var i = 0; i < 64; ++i) { - var ch = String.fromCharCode(blocks[i + j * 64 + scr * 1024]); - ctx.fillStyle = '#fb0'; - ctx.fillText(ch, (i + 0.5) * w, (j + 0.5) * h); + ctx.fillStyle = '#fb0'; + if (window.onkeydown === Login) { + ctx.fillText('password:', 0.5 * w * 9, 0.5 * h); + } else { + for (var j = 0; j < 16; ++j) { + for (var i = 0; i < 64; ++i) { + var ch = String.fromCharCode(blocks[i + j * 64 + scr * 1024]); + ctx.fillText(ch, (i + 0.5) * w, (j + 0.5) * h); + } } } ctx.fillStyle = '#750';