From 9f54870fcc3d25e5f4bd2956708af73f8c0ae599 Mon Sep 17 00:00:00 2001 From: ProgramComputer <22284856+ProgramComputer@users.noreply.github.com> Date: Sun, 31 Dec 2023 05:07:16 +0000 Subject: [PATCH 01/11] Close Key down not occurring in Test mode #159 --- js/pgm.js | 4 ++-- src/js/jq_pgm.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/pgm.js b/js/pgm.js index 4105d0ea..bf7d752a 100644 --- a/js/pgm.js +++ b/js/pgm.js @@ -98,9 +98,9 @@ if(e.which==27){showRightFrames('set_test_status.php?wid='+WID+'&status='+$('.wo if(e.which==73){showRightFrames('set_test_status.php?wid='+WID+'&status=98');return!1} if(e.which==87){showRightFrames('set_test_status.php?wid='+WID+'&status=99');return!1} if(e.which==69){showRightFrames('edit_tword.php?wid='+WID);return!1} -if(OPENED==0)return!0;if(e.which==40){showRightFrames('set_test_status.php?wid='+WID+'&stchange=-1');return!1} +if(e.which==40){showRightFrames('set_test_status.php?wid='+WID+'&stchange=-1');return!1} for(let i=1;i<=5;i++){if(e.which==(48+i)||e.which==(96+i)){showRightFrames('set_test_status.php?wid='+WID+'&status='+i);return!1}} -return!0} +if(OPENED==0)return!0;return!0} function word_each_do_text_text(_){const wid=$(this).attr('data_wid');if(wid!=''){const order=$(this).attr('data_order');if(order in ANN_ARRAY){if(wid==ANN_ARRAY[order][1]){const ann=ANN_ARRAY[order][2];const re=new RegExp('(['+DELIMITER+'][ ]{0,1}|^)('+ann.replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&')+')($|[ ]{0,1}['+DELIMITER+'])','');if(!re.test($(this).attr('data_trans').replace(/ \[.*$/,''))){const trans=ann+' / '+$(this).attr('data_trans');$(this).attr('data_trans',trans.replace(' / *',''))} $(this).attr('data_ann',ann)}}} if(!JQ_TOOLTIP){this.title=make_tooltip($(this).text(),$(this).attr('data_trans'),$(this).attr('data_rom'),$(this).attr('data_status'))}} diff --git a/src/js/jq_pgm.js b/src/js/jq_pgm.js index 16c5ef16..1a544ea1 100644 --- a/src/js/jq_pgm.js +++ b/src/js/jq_pgm.js @@ -538,7 +538,6 @@ function keydown_event_do_test_test (e) { showRightFrames('edit_tword.php?wid=' + WID); return false; } - if (OPENED == 0) return true; if (e.which == 40) { // down : status-1 showRightFrames('set_test_status.php?wid=' + WID + '&stchange=-1'); @@ -551,6 +550,7 @@ function keydown_event_do_test_test (e) { return false; } } + if (OPENED == 0) return true; return true; } From 7636664a39b9c74e7b017d574bcc28e2a0ec9577 Mon Sep 17 00:00:00 2001 From: ProgramComputer <22284856+ProgramComputer@users.noreply.github.com> Date: Sun, 31 Dec 2023 16:37:53 +0000 Subject: [PATCH 02/11] language_id phonetic_reading --- api.php | 4 ++-- do_test_test.php | 2 +- do_text_header.php | 2 +- inc/ajax_get_phonetic.php | 4 ++-- inc/session_utility.php | 10 +++++++--- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/api.php b/api.php index 5b65230d..a057dfc4 100644 --- a/api.php +++ b/api.php @@ -146,7 +146,7 @@ function media_files($get_req) /** * Get the phonetic reading of a word based on it's language. * - * @param array $get_req Array with the fields "text" and "lang" (short language name) + * @param array $get_req Array with the fields "text" and "lang_id" (language_id) * * @return string[] JSON-encoded result * @@ -154,7 +154,7 @@ function media_files($get_req) */ function get_phonetic_reading($get_req): array { - $data = phonetic_reading($get_req['text'], $get_req['lang']); + $data = phonetic_reading($get_req['text'], $get_req['lang_id']); return array("phonetic_reading" => $data); } diff --git a/do_test_test.php b/do_test_test.php index 958d9e69..1f86e5d1 100644 --- a/do_test_test.php +++ b/do_test_test.php @@ -704,7 +704,7 @@ function do_test_test_javascript_clickable($wo_record, $solution) { $wid = $wo_record['WoID']; $abbr = getLanguageCode($wo_record['WoLgID'], LWT_LANGUAGES_ARRAY); - $phoneticText = phonetic_reading($wo_record['WoText'], $abbr); + $phoneticText = phonetic_reading($wo_record['WoText'], $wo_record['WoLgID']); ?>