js: Use current_key_label() to label feature phone softkeys

This commit is contained in:
Ben Harris
2022-12-05 01:16:16 +00:00
parent e5604ccf37
commit 420663d477
3 changed files with 21 additions and 1 deletions

View File

@ -220,6 +220,21 @@ mergeInto(LibraryManager.library, {
disable_menu_item(redo_button, (redo == 0));
},
/*
* void js_enable_undo_redo(bool undo, bool redo);
*
* Update any labels for the SoftLeft and Enter keys.
*/
js_update_key_labels: function(lsk_ptr, csk_ptr) {
var elem;
var lsk_text = UTF8ToString(lsk_ptr);
var csk_text = UTF8ToString(csk_ptr);
for (elem of document.querySelectorAll("#puzzle .lsk"))
elem.textContent = lsk_text == csk_text ? "" : lsk_text;
for (elem of document.querySelectorAll("#puzzle .csk"))
elem.textContent = csk_text;
},
/*
* void js_activate_timer();
*