From 2c0fac1304a322bbca81eed3d1bd2acafd627163 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Mon, 2 Oct 2023 07:39:35 +0000 Subject: [PATCH 1/7] DEMO won't load in db without privilege --- INSTALL.sh | 3 ++- do_text_text.php | 1 + inc/kernel_utility.php | 3 +++ js/pgm.js | 5 +++-- settings.php | 22 +++++++++++++++++++++- src/js/jq_pgm.js | 5 +++++ 6 files changed, 35 insertions(+), 4 deletions(-) mode change 100644 => 100755 INSTALL.sh diff --git a/INSTALL.sh b/INSTALL.sh old mode 100644 new mode 100755 index 3ebdc3381..ab5b36562 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -27,7 +27,7 @@ echo # Database access settings echo "LWT needs to know how to access the database. You can change this options later in 'connect.inc.php'." -host=localhost +host=127.0.0.1 read -p "Database User Name [lwt]: " -r user user=${user:-lwt} read -p "Database Password [abcxyz]: " -r passwd @@ -41,6 +41,7 @@ echo "Creating the MySQL user and database..." sudo mysql -e "CREATE USER $user@$host IDENTIFIED BY '$passwd'" sudo mysql -e "CREATE DATABASE $db_name" sudo mysql -e "GRANT ALL PRIVILEGES ON $db_name.* TO $user@$host" +sudo mysql -e "GRANT SYSTEM_VARIABLES_ADMIN on *.* to $user@$host" echo # Database connection parameters diff --git a/do_text_text.php b/do_text_text.php index edc7917a8..9c7405a85 100644 --- a/do_text_text.php +++ b/do_text_text.php @@ -744,6 +744,7 @@ function do_text_text_content($textid, $only_body=true): void 'TID' => $textid, 'ADDFILTER' => makeStatusClassFilter((int)$visit_status), 'JQ_TOOLTIP' => getSettingWithDefault('set-tooltip-mode') == 2 ? 1 : 0, + 'HTS' => getSettingWithDefault('set-hts') == 1 ? 1 : 0, // Add new globals 'ANNOTATIONS_MODE' => $mode_trans, 'POS' => $pos diff --git a/inc/kernel_utility.php b/inc/kernel_utility.php index 77f90c03f..14547623b 100644 --- a/inc/kernel_utility.php +++ b/inc/kernel_utility.php @@ -162,6 +162,9 @@ function get_setting_data() 'set-tts' => array( "dft" => '1', "num" => 0 ), + 'set-hts' => array( + "dft" => '0', "num" => 0 + ), 'set-term-sentence-count' => array( "dft" => '1', "num" => 0 ), diff --git a/js/pgm.js b/js/pgm.js index 3077acbc7..befeac01d 100644 --- a/js/pgm.js +++ b/js/pgm.js @@ -65,7 +65,7 @@ $('input[name=\'step\']').val(++val);document.lwt_form1.submit();return!1});$(do * @author andreask7 * @since 1.6.16-fork */ -TEXTPOS=-1;OPENED=0;WID=0;TID=0;WBLINK1='';WBLINK2='';WBLINK3='';SOLUTION='';ADDFILTER='';RTL=0;ANN_ARRAY={};DELIMITER='';JQ_TOOLTIP=0;function setTransRoman(tra,rom){let form_changed=!1;if($('textarea[name="WoTranslation"]').length==1){$('textarea[name="WoTranslation"]').val(tra);form_changed|=!0} +TEXTPOS=-1;OPENED=0;WID=0;TID=0;WBLINK1='';WBLINK2='';WBLINK3='';SOLUTION='';ADDFILTER='';RTL=0;ANN_ARRAY={};DELIMITER='';JQ_TOOLTIP=0;HTS=0;function setTransRoman(tra,rom){let form_changed=!1;if($('textarea[name="WoTranslation"]').length==1){$('textarea[name="WoTranslation"]').val(tra);form_changed|=!0} if($('input[name="WoRomanization"]').length==1){$('input[name="WoRomanization"]').val(rom);form_changed|=!0} if(form_changed) makeDirty();} @@ -127,7 +127,8 @@ return!1} function mword_drag_n_drop_select(event){if(JQ_TOOLTIP)$('.ui-tooltip').remove();const context=$(this).parent();context.one('mouseup mouseout',$(this),function(){clearTimeout(to);$('.nword').removeClass('nword');$('.tword').removeClass('tword');$('.lword').removeClass('lword');$('.wsty',context).css('background-color','').css('border-bottom-color','');$('#pe').remove()});to=setTimeout(function(){let pos;context.off('mouseout');$('.wsty',context).css('background-color','inherit').css('border-bottom-color','rgba(0,0,0,0)').not('.hide,.word').each(function(){f=parseInt($(this).attr('data_code'))*2+parseInt($(this).attr('data_order'))-1;h='';$(this).nextUntil($('[id^="ID-'+f+'-"]',context),'[id$="-1"]').each(function(){l=$(this).attr('data_order');if(typeof l!=='undefined'){h+=''+$(this).text()+''}else{h+=''+$(this).text()+''}});$(this).html(h)});$('#pe').remove();$('body').append('');$('[id$="-1"]',context).not('.hide,.wsty').addClass('nword').each(function(){$(this).attr('data_order',$(this).attr('id').split('-')[1])});$('.word',context).not('.hide').each(function(){$(this).html(''+$(this).text()+'')});if(event.data.annotation==1){$('.wsty',context).not('.hide').each(function(){$(this).children('.tword').last().attr('data_ann',$(this).attr('data_ann')).attr('data_trans',$(this).attr('data_trans')).addClass('content'+$(this).removeClass('status1 status2 status3 status4 status5 status98 status99').attr('data_status'))})}else if(event.data.annotation==3){$('.wsty',context).not('.hide').each(function(){$(this).children('.tword').first().attr('data_ann',$(this).attr('data_ann')).attr('data_trans',$(this).attr('data_trans')).addClass('content'+$(this).removeClass('status1 status2 status3 status4 status5 status98 status99').attr('data_status'))})} $(context).one('mouseover','.tword',function(){$('html').one('mouseup',function(){$('.wsty',context).each(function(){$(this).addClass('status'+$(this).attr('data_status'))});if(!$(this).hasClass('tword')){$('span',context).removeClass('nword tword lword');$('.wsty',context).css('background-color','').css('border-bottom-color','');$('#pe').remove()}});pos=parseInt($(this).attr('data_order'));$('.lword',context).removeClass('lword');$(this).addClass('lword');$(context).on('mouseleave',function(){$('.lword',context).removeClass('lword')});$(context).one('mouseup','.nword,.tword',function(ev){if(ev.handled!==!0){const len=$('.lword.tword',context).length;if(len>0){g=$('.lword',context).first().attr('data_order');if(len>1){const text=$('.lword',context).map(function(){return $(this).text()}).get().join('');if(text.length>250){alert('selected text is too long!!!')}else{showRightFrames('edit_mword.php?tid='+TID+'&len='+len+'&ord='+g+'&txt='+text)}}else{showRightFrames('edit_word.php?tid='+TID+'&ord='+g+'&txt='+$('#ID-'+g+'-1').text())}} $('span',context).removeClass('tword nword');ev.handled=!0}})});$(context).hoverIntent({over:function(){$('.lword',context).removeClass('lword');const lpos=parseInt($(this).attr('data_order'));$(this).addClass('lword');if(lpos>pos){for(var i=pos;ilpos;i--){$('.tword[data_order="'+i+'"],.nword[data_order="'+i+'"]',context).addClass('lword')}}},out:function(){},sensitivity:18,selector:'.tword'})},300)} -function word_hover_over(){if(!$('.tword')[0]){const v=$(this).attr('class').replace(/.*(TERM[^ ]*)( .*)*/,'$1');$('.'+v).addClass('hword');if(JQ_TOOLTIP){$(this).trigger('mouseover')}}} +function word_hover_over(){if(!$('.tword')[0]){const v=$(this).attr('class').replace(/.*(TERM[^ ]*)( .*)*/,'$1');$('.'+v).addClass('hword');if(JQ_TOOLTIP){$(this).trigger('mouseover');if(HTS){console.log(HTS) +const lg=getLangFromDict(WBLINK3);readTextAloud($(this).text(),lg)}}}} function word_hover_out(){$('.hword').removeClass('hword');if(JQ_TOOLTIP)$('.ui-helper-hidden-accessible>div[style]').remove();} jQuery.fn.extend({tooltip_wsty_content:function(){var re=new RegExp('(['+DELIMITER+'])(?! )','g');let title='';if($(this).hasClass('mwsty')){title="

"+$(this).attr('data_text')+'

'}else{title="

"+$(this).text()+'

'} const roman=$(this).attr('data_rom');let trans=$(this).attr('data_trans').replace(re,'$1 ');let statname='';const status=parseInt($(this).attr('data_status'));if(status==0)statname='Unknown [?]';else if(status<5)statname='Learning ['+status+']';if(status==5)statname='Learned [5]';if(status==98)statname='Ignored [Ign]';if(status==99)statname='Well Known [WKn]';if(roman!=''){title+='

Roman.: '+roman+'

'} diff --git a/settings.php b/settings.php index 02dc028ac..e0f14018b 100644 --- a/settings.php +++ b/settings.php @@ -107,6 +107,14 @@ 1 : 0 ) ); + saveSetting( + 'set-hts', + ( + array_key_exists('set-hts', $_REQUEST) && + (int)$_REQUEST['set-hts'] ? + 1 : 0 + ) + ); saveSetting( 'set-archivedtexts-per-page', @@ -564,7 +572,7 @@ - Text to Speech + Text to Speech Save Audio Files to Disk + + Always speak when hovering + + /> + + + Field must not be empty + + + Text, Term,
Newsfeed &
Tag Tables Texts per Page diff --git a/src/js/jq_pgm.js b/src/js/jq_pgm.js index 269e1d264..53c0db990 100644 --- a/src/js/jq_pgm.js +++ b/src/js/jq_pgm.js @@ -31,6 +31,7 @@ RTL = 0; ANN_ARRAY = {}; DELIMITER = ''; JQ_TOOLTIP = 0; +HTS = 0; /************************************************************** LWT jQuery functions @@ -859,6 +860,10 @@ function word_hover_over () { $('.' + v).addClass('hword'); if (JQ_TOOLTIP) { $(this).trigger('mouseover'); + if (HTS) { + const lg = getLangFromDict(WBLINK3); + readTextAloud($(this).text(), lg); + } } } } From 830bd29f6a915414b1c242e3e106c029e8f9669a Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Mon, 2 Oct 2023 07:45:11 +0000 Subject: [PATCH 2/7] DEMO won't load in DB without admin? --- INSTALL.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.sh b/INSTALL.sh index ab5b36562..4cd19efee 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -41,7 +41,7 @@ echo "Creating the MySQL user and database..." sudo mysql -e "CREATE USER $user@$host IDENTIFIED BY '$passwd'" sudo mysql -e "CREATE DATABASE $db_name" sudo mysql -e "GRANT ALL PRIVILEGES ON $db_name.* TO $user@$host" -sudo mysql -e "GRANT SYSTEM_VARIABLES_ADMIN on *.* to $user@$host" +sudo mysql -e "GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO $user@$host" echo # Database connection parameters From 355a503695bb6dda6f744802437bb847944fbfd0 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Mon, 2 Oct 2023 07:47:05 +0000 Subject: [PATCH 3/7] composer build --- js/pgm.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/pgm.js b/js/pgm.js index befeac01d..73889772d 100644 --- a/js/pgm.js +++ b/js/pgm.js @@ -127,8 +127,7 @@ return!1} function mword_drag_n_drop_select(event){if(JQ_TOOLTIP)$('.ui-tooltip').remove();const context=$(this).parent();context.one('mouseup mouseout',$(this),function(){clearTimeout(to);$('.nword').removeClass('nword');$('.tword').removeClass('tword');$('.lword').removeClass('lword');$('.wsty',context).css('background-color','').css('border-bottom-color','');$('#pe').remove()});to=setTimeout(function(){let pos;context.off('mouseout');$('.wsty',context).css('background-color','inherit').css('border-bottom-color','rgba(0,0,0,0)').not('.hide,.word').each(function(){f=parseInt($(this).attr('data_code'))*2+parseInt($(this).attr('data_order'))-1;h='';$(this).nextUntil($('[id^="ID-'+f+'-"]',context),'[id$="-1"]').each(function(){l=$(this).attr('data_order');if(typeof l!=='undefined'){h+=''+$(this).text()+''}else{h+=''+$(this).text()+''}});$(this).html(h)});$('#pe').remove();$('body').append('');$('[id$="-1"]',context).not('.hide,.wsty').addClass('nword').each(function(){$(this).attr('data_order',$(this).attr('id').split('-')[1])});$('.word',context).not('.hide').each(function(){$(this).html(''+$(this).text()+'')});if(event.data.annotation==1){$('.wsty',context).not('.hide').each(function(){$(this).children('.tword').last().attr('data_ann',$(this).attr('data_ann')).attr('data_trans',$(this).attr('data_trans')).addClass('content'+$(this).removeClass('status1 status2 status3 status4 status5 status98 status99').attr('data_status'))})}else if(event.data.annotation==3){$('.wsty',context).not('.hide').each(function(){$(this).children('.tword').first().attr('data_ann',$(this).attr('data_ann')).attr('data_trans',$(this).attr('data_trans')).addClass('content'+$(this).removeClass('status1 status2 status3 status4 status5 status98 status99').attr('data_status'))})} $(context).one('mouseover','.tword',function(){$('html').one('mouseup',function(){$('.wsty',context).each(function(){$(this).addClass('status'+$(this).attr('data_status'))});if(!$(this).hasClass('tword')){$('span',context).removeClass('nword tword lword');$('.wsty',context).css('background-color','').css('border-bottom-color','');$('#pe').remove()}});pos=parseInt($(this).attr('data_order'));$('.lword',context).removeClass('lword');$(this).addClass('lword');$(context).on('mouseleave',function(){$('.lword',context).removeClass('lword')});$(context).one('mouseup','.nword,.tword',function(ev){if(ev.handled!==!0){const len=$('.lword.tword',context).length;if(len>0){g=$('.lword',context).first().attr('data_order');if(len>1){const text=$('.lword',context).map(function(){return $(this).text()}).get().join('');if(text.length>250){alert('selected text is too long!!!')}else{showRightFrames('edit_mword.php?tid='+TID+'&len='+len+'&ord='+g+'&txt='+text)}}else{showRightFrames('edit_word.php?tid='+TID+'&ord='+g+'&txt='+$('#ID-'+g+'-1').text())}} $('span',context).removeClass('tword nword');ev.handled=!0}})});$(context).hoverIntent({over:function(){$('.lword',context).removeClass('lword');const lpos=parseInt($(this).attr('data_order'));$(this).addClass('lword');if(lpos>pos){for(var i=pos;ilpos;i--){$('.tword[data_order="'+i+'"],.nword[data_order="'+i+'"]',context).addClass('lword')}}},out:function(){},sensitivity:18,selector:'.tword'})},300)} -function word_hover_over(){if(!$('.tword')[0]){const v=$(this).attr('class').replace(/.*(TERM[^ ]*)( .*)*/,'$1');$('.'+v).addClass('hword');if(JQ_TOOLTIP){$(this).trigger('mouseover');if(HTS){console.log(HTS) -const lg=getLangFromDict(WBLINK3);readTextAloud($(this).text(),lg)}}}} +function word_hover_over(){if(!$('.tword')[0]){const v=$(this).attr('class').replace(/.*(TERM[^ ]*)( .*)*/,'$1');$('.'+v).addClass('hword');if(JQ_TOOLTIP){$(this).trigger('mouseover');if(HTS){const lg=getLangFromDict(WBLINK3);readTextAloud($(this).text(),lg)}}}} function word_hover_out(){$('.hword').removeClass('hword');if(JQ_TOOLTIP)$('.ui-helper-hidden-accessible>div[style]').remove();} jQuery.fn.extend({tooltip_wsty_content:function(){var re=new RegExp('(['+DELIMITER+'])(?! )','g');let title='';if($(this).hasClass('mwsty')){title="

"+$(this).attr('data_text')+'

'}else{title="

"+$(this).text()+'

'} const roman=$(this).attr('data_rom');let trans=$(this).attr('data_trans').replace(re,'$1 ');let statname='';const status=parseInt($(this).attr('data_status'));if(status==0)statname='Unknown [?]';else if(status<5)statname='Learning ['+status+']';if(status==5)statname='Learned [5]';if(status==98)statname='Ignored [Ign]';if(status==99)statname='Well Known [WKn]';if(roman!=''){title+='

Roman.: '+roman+'

'} From 96e1dde90fc3cd5b6b82a19b9e2cb0bc5298b837 Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Mon, 2 Oct 2023 08:51:18 +0000 Subject: [PATCH 4/7] outside --- js/pgm.js | 3 ++- src/js/jq_pgm.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js/pgm.js b/js/pgm.js index 73889772d..a90657177 100644 --- a/js/pgm.js +++ b/js/pgm.js @@ -127,7 +127,8 @@ return!1} function mword_drag_n_drop_select(event){if(JQ_TOOLTIP)$('.ui-tooltip').remove();const context=$(this).parent();context.one('mouseup mouseout',$(this),function(){clearTimeout(to);$('.nword').removeClass('nword');$('.tword').removeClass('tword');$('.lword').removeClass('lword');$('.wsty',context).css('background-color','').css('border-bottom-color','');$('#pe').remove()});to=setTimeout(function(){let pos;context.off('mouseout');$('.wsty',context).css('background-color','inherit').css('border-bottom-color','rgba(0,0,0,0)').not('.hide,.word').each(function(){f=parseInt($(this).attr('data_code'))*2+parseInt($(this).attr('data_order'))-1;h='';$(this).nextUntil($('[id^="ID-'+f+'-"]',context),'[id$="-1"]').each(function(){l=$(this).attr('data_order');if(typeof l!=='undefined'){h+=''+$(this).text()+''}else{h+=''+$(this).text()+''}});$(this).html(h)});$('#pe').remove();$('body').append('');$('[id$="-1"]',context).not('.hide,.wsty').addClass('nword').each(function(){$(this).attr('data_order',$(this).attr('id').split('-')[1])});$('.word',context).not('.hide').each(function(){$(this).html(''+$(this).text()+'')});if(event.data.annotation==1){$('.wsty',context).not('.hide').each(function(){$(this).children('.tword').last().attr('data_ann',$(this).attr('data_ann')).attr('data_trans',$(this).attr('data_trans')).addClass('content'+$(this).removeClass('status1 status2 status3 status4 status5 status98 status99').attr('data_status'))})}else if(event.data.annotation==3){$('.wsty',context).not('.hide').each(function(){$(this).children('.tword').first().attr('data_ann',$(this).attr('data_ann')).attr('data_trans',$(this).attr('data_trans')).addClass('content'+$(this).removeClass('status1 status2 status3 status4 status5 status98 status99').attr('data_status'))})} $(context).one('mouseover','.tword',function(){$('html').one('mouseup',function(){$('.wsty',context).each(function(){$(this).addClass('status'+$(this).attr('data_status'))});if(!$(this).hasClass('tword')){$('span',context).removeClass('nword tword lword');$('.wsty',context).css('background-color','').css('border-bottom-color','');$('#pe').remove()}});pos=parseInt($(this).attr('data_order'));$('.lword',context).removeClass('lword');$(this).addClass('lword');$(context).on('mouseleave',function(){$('.lword',context).removeClass('lword')});$(context).one('mouseup','.nword,.tword',function(ev){if(ev.handled!==!0){const len=$('.lword.tword',context).length;if(len>0){g=$('.lword',context).first().attr('data_order');if(len>1){const text=$('.lword',context).map(function(){return $(this).text()}).get().join('');if(text.length>250){alert('selected text is too long!!!')}else{showRightFrames('edit_mword.php?tid='+TID+'&len='+len+'&ord='+g+'&txt='+text)}}else{showRightFrames('edit_word.php?tid='+TID+'&ord='+g+'&txt='+$('#ID-'+g+'-1').text())}} $('span',context).removeClass('tword nword');ev.handled=!0}})});$(context).hoverIntent({over:function(){$('.lword',context).removeClass('lword');const lpos=parseInt($(this).attr('data_order'));$(this).addClass('lword');if(lpos>pos){for(var i=pos;ilpos;i--){$('.tword[data_order="'+i+'"],.nword[data_order="'+i+'"]',context).addClass('lword')}}},out:function(){},sensitivity:18,selector:'.tword'})},300)} -function word_hover_over(){if(!$('.tword')[0]){const v=$(this).attr('class').replace(/.*(TERM[^ ]*)( .*)*/,'$1');$('.'+v).addClass('hword');if(JQ_TOOLTIP){$(this).trigger('mouseover');if(HTS){const lg=getLangFromDict(WBLINK3);readTextAloud($(this).text(),lg)}}}} +function word_hover_over(){if(!$('.tword')[0]){const v=$(this).attr('class').replace(/.*(TERM[^ ]*)( .*)*/,'$1');$('.'+v).addClass('hword');if(JQ_TOOLTIP){$(this).trigger('mouseover')} +if(HTS){const lg=getLangFromDict(WBLINK3);readTextAloud($(this).text(),lg)}}} function word_hover_out(){$('.hword').removeClass('hword');if(JQ_TOOLTIP)$('.ui-helper-hidden-accessible>div[style]').remove();} jQuery.fn.extend({tooltip_wsty_content:function(){var re=new RegExp('(['+DELIMITER+'])(?! )','g');let title='';if($(this).hasClass('mwsty')){title="

"+$(this).attr('data_text')+'

'}else{title="

"+$(this).text()+'

'} const roman=$(this).attr('data_rom');let trans=$(this).attr('data_trans').replace(re,'$1 ');let statname='';const status=parseInt($(this).attr('data_status'));if(status==0)statname='Unknown [?]';else if(status<5)statname='Learning ['+status+']';if(status==5)statname='Learned [5]';if(status==98)statname='Ignored [Ign]';if(status==99)statname='Well Known [WKn]';if(roman!=''){title+='

Roman.: '+roman+'

'} diff --git a/src/js/jq_pgm.js b/src/js/jq_pgm.js index 53c0db990..ebe2de12a 100644 --- a/src/js/jq_pgm.js +++ b/src/js/jq_pgm.js @@ -860,11 +860,11 @@ function word_hover_over () { $('.' + v).addClass('hword'); if (JQ_TOOLTIP) { $(this).trigger('mouseover'); - if (HTS) { - const lg = getLangFromDict(WBLINK3); - readTextAloud($(this).text(), lg); - } } + if (HTS) { + const lg = getLangFromDict(WBLINK3); + readTextAloud($(this).text(), lg); + } } } From db49b653e412bf0bf4894162923aff5e339b4ccf Mon Sep 17 00:00:00 2001 From: Paul <22284856+ProgramComputer@users.noreply.github.com> Date: Tue, 26 Dec 2023 01:06:36 +0000 Subject: [PATCH 5/7] host change --- INSTALL.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.sh b/INSTALL.sh index 4cd19efee..ab7188bfa 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -27,7 +27,7 @@ echo # Database access settings echo "LWT needs to know how to access the database. You can change this options later in 'connect.inc.php'." -host=127.0.0.1 +host=localhost read -p "Database User Name [lwt]: " -r user user=${user:-lwt} read -p "Database Password [abcxyz]: " -r passwd From 3c960afafa59c094cf3ee11bd5f9ed4e42db638f Mon Sep 17 00:00:00 2001 From: ProgramComputer <22284856+ProgramComputer@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:47:16 +0000 Subject: [PATCH 6/7] add dropdown --- do_text_text.php | 2 +- inc/kernel_utility.php | 2 +- inc/session_utility.php | 14 ++++++++++++++ settings.php | 24 ++++++++++++------------ src/js/jq_pgm.js | 6 +++++- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/do_text_text.php b/do_text_text.php index 9c7405a85..71c42cff1 100644 --- a/do_text_text.php +++ b/do_text_text.php @@ -744,7 +744,7 @@ function do_text_text_content($textid, $only_body=true): void 'TID' => $textid, 'ADDFILTER' => makeStatusClassFilter((int)$visit_status), 'JQ_TOOLTIP' => getSettingWithDefault('set-tooltip-mode') == 2 ? 1 : 0, - 'HTS' => getSettingWithDefault('set-hts') == 1 ? 1 : 0, + 'HTS' => getSettingWithDefault('set-hts'), // Add new globals 'ANNOTATIONS_MODE' => $mode_trans, 'POS' => $pos diff --git a/inc/kernel_utility.php b/inc/kernel_utility.php index 14547623b..843b48e5a 100644 --- a/inc/kernel_utility.php +++ b/inc/kernel_utility.php @@ -163,7 +163,7 @@ function get_setting_data() "dft" => '1', "num" => 0 ), 'set-hts' => array( - "dft" => '0', "num" => 0 + "dft" => '1', "num" => 0 ), 'set-term-sentence-count' => array( "dft" => '1', "num" => 0 diff --git a/inc/session_utility.php b/inc/session_utility.php index c01ca82d6..0126ffcb4 100644 --- a/inc/session_utility.php +++ b/inc/session_utility.php @@ -2383,6 +2383,20 @@ function get_annotation_position_selectoptions($v): string $r .= ">Above"; return $r; } +// ------------------------------------------------------------- + +function get_hts_selectoptions($v): string +{ + if (! isset($v) ) { $v = 1; + } + $r = "