diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 83179c2a..f8b866b3 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1418,5 +1418,13 @@ "customPrompts_Properties": { "message": "Properties", "description": "" + }, + "customPrompts_show_additional_info": { + "message": "Show ChatGPT additional properties", + "description": "" + }, + "customPrompts_hide_additional_info": { + "message": "Hide ChatGPT additional properties", + "description": "" } } \ No newline at end of file diff --git a/pages/customprompts/mzta-custom-prompts.css b/pages/customprompts/mzta-custom-prompts.css index e73f8e12..9aa04f59 100644 --- a/pages/customprompts/mzta-custom-prompts.css +++ b/pages/customprompts/mzta-custom-prompts.css @@ -227,6 +227,15 @@ table .sort.desc { cursor: pointer; } +#chatgpt_web_additional_info_toggle:hover{ + background-color: rgb(255, 189, 153); + text-decoration: underline; +} + +#chatgpt_web_additional_info_toggle td{ + text-align: center; +} + #chatgpt_web_additional_info td{ vertical-align: top; } diff --git a/pages/customprompts/mzta-custom-prompts.html b/pages/customprompts/mzta-custom-prompts.html index d9312a1a..fd787fde 100644 --- a/pages/customprompts/mzta-custom-prompts.html +++ b/pages/customprompts/mzta-custom-prompts.html @@ -78,7 +78,7 @@ - Show ChatGPT additional properties + __MSG_customPrompts_show_additional_info__ diff --git a/pages/customprompts/mzta-custom-prompts.js b/pages/customprompts/mzta-custom-prompts.js index 91371bb9..dbdee54e 100644 --- a/pages/customprompts/mzta-custom-prompts.js +++ b/pages/customprompts/mzta-custom-prompts.js @@ -119,6 +119,25 @@ document.addEventListener('DOMContentLoaded', async () => { // break; } + const chatgptWebAdditionalPropToggle = document.getElementById('chatgpt_web_additional_info_toggle'); + chatgptWebAdditionalPropToggle.addEventListener('click', (e) => { + e.preventDefault(); + const additionalInfoRow = document.getElementById('chatgpt_web_additional_info'); + if (additionalInfoRow.style.display === 'none' || additionalInfoRow.style.display === '') { + additionalInfoRow.style.display = 'table-row'; + let subspan = chatgptWebAdditionalPropToggle.querySelector('td span'); + if (subspan) { + subspan.innerText = browser.i18n.getMessage('customPrompts_hide_additional_info'); + } + } else { + additionalInfoRow.style.display = 'none'; + let subspan = chatgptWebAdditionalPropToggle.querySelector('td span'); + if (subspan) { + subspan.innerText = browser.i18n.getMessage('customPrompts_show_additional_info'); + } + } + }); + //To add a new item var txtIdNew = document.getElementById('txtIdNew');