[kanji] Javascript overhaul

57 views
Skip to first unread message

Ben Bullock

unread,
Jan 17, 2023, 11:01:47 PM1/17/23
to sljfaq.org
I've done quite a lot of work overhauling the Javascript of kanji.sljfaq.org, such as removing old unused code etc. 

There are a few user visible changes such as wider use of the message box rather than "alert" and better user error messages on the "kana input" page.

On the handwritten page, the old "alert" which would pop up if the user tried to make an image with no input, or if the user entered too many strokes, is now just a message.

The work is ongoing but I need a break now and I'm not sure when it will continue.

As far as I can tell the site is working correctly now, but if something does go wrong I'll report it here.

Ben Bullock

unread,
Jan 18, 2023, 9:37:07 PM1/18/23
to sljfaq.org
Further to the above-mentioned work I've done some more work on the SKIP page including overhauling the JavaScript again and also adding a "reset" button which puts the fields back to their original values. I've also made the input boxes smaller. They have had "size" fields since years before, but for some reason the HTML form input type of number doesn't allow size fields to work. Web "standards" seem to be little more than just somebody or another's random thoughts on a particular day, hard to imagine a committee actually thought about this at all, although I'm sure there are several hundreds of names on the standards document which decided this particular bit of lunacy.

Ben Bullock

unread,
Jan 19, 2023, 2:03:56 AM1/19/23
to sljfaq.org
An error had been preventing user images from becoming visible, which I've now fixed. This affects users of the "Make user image" button underneath the drawing canvas.

Ben Bullock

unread,
Jan 19, 2023, 6:59:19 PM1/19/23
to sljf...@googlegroups.com
More work on this removes some old unused Javascript, and now also handles the errors which occur when the user inputs a scribbly line using the "Ignore stroke order" option.

squiggle.png

A ridiculous amount of cross-hatching will also send a message:

scribble.png

These messages only relate to the "Ignore stroke order" choice. Prior to this update, the error was being returned, but it was not being handled at all, so the user would have just got a blank answer box.

I haven't updated the Javascript version number for these changes, so a page reload might be required.

The last of the "alerts" (popup windows where you have to press OK to continue using the site) has now gone, and all user messaging is now carried out via the above message box (the brown part). Work on improving the design will continue, obviously.

Ben Bullock

unread,
Jan 21, 2023, 11:06:45 PM1/21/23
to sljf...@googlegroups.com
Continuing the "minor fixes" on kanji.sljfaq.org, I've changed the Javascript for the draw page to prevent a problem where the "draw-old.html" page would have the look-ahead button disabled when opening the page if coming from the "draw.html" page.

Although this seems like a silly minor bug it was in fact the result of a very bad design choice, so I've bumped up the version to 105. Please "shift-reload" if problems persist.

I've also done some work on filling in the Finnish-language version of the pages to add Finnish translations. I'll try to gradually complete more languages as I go along. These are merely Google translations unfortunately.

On the back end I've done considerable work to make the Javascript much easier to work with, but this isn't user-visible.


Ben Bullock

unread,
Jan 21, 2023, 11:11:32 PM1/21/23
to sljf...@googlegroups.com
I forgot to mention one change which hopefully improves things, which is the option page now SHOWS which site is the default, so when you press "reset" on

https://kanji.sljfaq.org/option.html

it shows that the wwwjdic_aus choice is the default. Prior to this it was unchecking all of the boxes so it was a bit mystifying. The Japanese-language version of the page shows the "this site" option as the default.

There is also now a button to reset all the draw option cookies:

option.png


Ben Bullock

unread,
Jan 23, 2023, 4:27:59 AM1/23/23
to sljf...@googlegroups.com
Another change to the kanji.sljfaq.org site adds a more prominent and conspicuous "Reset" button to the output results on the multiradical, SKIP, four-corner, and radical search pages which clears all the results and sets all the buttons back to the original state. Most of the pages already had a reset button but it was placed in various corners of the page. This puts it next to the "results" title.

Control-click on the top menu is now slightly improved in that it should work correctly even when clicking on whitespace areas of the menu. Prior to this update it would not correctly detect that the control key was pressed and open in a new window.

The background colour of the user message has changed slightly to a more brown colour. Design improvements will continue.

Ben Bullock

unread,
Jan 23, 2023, 4:35:25 AM1/23/23
to sljfaq.org
Trying this on the site, there are some problems with caching, so I've incremented the JavaScript version to 106 to clear this up.

Ben Bullock

unread,
Jan 25, 2023, 6:37:19 PM1/25/23
to sljf...@googlegroups.com
Hi everybody,

Continuing on with the work on kanji.sljfaq.org, a user-requested feature from last year was to be able to remove the new buttons since some people apparently find them to be annoying:

old-buttons-off-draw.png

What I've done is to add an option to https://kanji.sljfaq.org/option.html:

old-buttons-on-options.png

With this, the user can go back to using the old buttons:

old-buttons-on-draw.png

I wrote to the user who'd requested this change to get feedback but unfortunately he hasn't replied.

I've also fixed a bug in kanji.sljfaq.org/draw-old.html where it was not able to produce the images successfully. "Make image file" should now work successfully on either draw or draw-old. The Javascript version is bumped to 107.

In addition to this, updates I've made but did not announce here include better translations into Russian, Finnish, and Thai. I am gradually going over all the translations into the other languages too. There is also a new "help" page about the kana input and various other minor changes.




Reply all
Reply to author
Forward
0 new messages