diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 82ee1781..1d516cd8 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -382,5 +382,9 @@
"currently_used_prompt": {
"message": "Currently used prompt name",
"description": ""
+ },
+ "customprompts_form_label_define_response_lang": {
+ "message": "Define the reponse languange in the prompt",
+ "description": ""
}
}
\ No newline at end of file
diff --git a/customprompts/mzta-custom-prompts.html b/customprompts/mzta-custom-prompts.html
index 59e01931..fa8a17eb 100644
--- a/customprompts/mzta-custom-prompts.html
+++ b/customprompts/mzta-custom-prompts.html
@@ -51,6 +51,8 @@
+
+
diff --git a/customprompts/mzta-custom-prompts.js b/customprompts/mzta-custom-prompts.js
index 779b59e1..d20f840c 100644
--- a/customprompts/mzta-custom-prompts.js
+++ b/customprompts/mzta-custom-prompts.js
@@ -114,6 +114,7 @@ document.addEventListener('DOMContentLoaded', async () => {
var checkboxNeedSelectedNew = document.getElementById('checkboxNeedSelectedNew');
var checkboxNeedSignatureNew = document.getElementById('checkboxNeedSignatureNew');
var checkboxNeedCustomTextNew = document.getElementById('checkboxNeedCustomTextNew');
+ var checkboxDefineResponseLangNew = document.getElementById('checkboxDefineResponseLangNew');
const btnAddNew = document.getElementById('btnAddNew');
btnAddNew.addEventListener('click', (e) => {
@@ -130,6 +131,7 @@ document.addEventListener('DOMContentLoaded', async () => {
need_selected: (checkboxNeedSelectedNew.checked) ? 1 : 0,
need_signature: (checkboxNeedSignatureNew.checked) ? 1 : 0,
need_custom_text: (checkboxNeedCustomTextNew.checked) ? 1 : 0,
+ define_response_lang: (checkboxDefineResponseLangNew.checked) ? 1 : 0,
enabled: 1,
position_compose: positionMax_compose + 1,
position_display: positionMax_display + 1,
@@ -273,6 +275,7 @@ function showItemRowEditor(tr) {
tr.querySelector('input.need_selected').disabled = false;
tr.querySelector('input.need_signature').disabled = false;
tr.querySelector('input.need_custom_text').disabled = false;
+ tr.querySelector('input.define_response_lang').disabled = false;
}
function hideItemRowEditor(tr) {
@@ -289,6 +292,7 @@ function hideItemRowEditor(tr) {
tr.querySelector('input.need_selected').disabled = true;
tr.querySelector('input.need_signature').disabled = true;
tr.querySelector('input.need_custom_text').disabled = true;
+ tr.querySelector('input.define_response_lang').disabled = true;
}
// Confirm and log deletion action
@@ -354,7 +358,7 @@ function handleInputChange(e) {
function loadPromptsList(values){
let options = {
- valueNames: [ { data: ['idnum'] }, 'is_default', 'id', 'name', 'text', 'type', 'action', 'position_compose', 'position_display', { name: 'need_selected', attr: 'checked_val'}, { name: 'need_signature', attr: 'checked_val'}, { name: 'need_custom_text', attr: 'checked_val'}, { name: 'enabled', attr: 'checked_val'} ],
+ valueNames: [ { data: ['idnum'] }, 'is_default', 'id', 'name', 'text', 'type', 'action', 'position_compose', 'position_display', { name: 'need_selected', attr: 'checked_val'}, { name: 'need_signature', attr: 'checked_val'}, { name: 'need_custom_text', attr: 'checked_val'}, { name: 'define_response_lang', attr: 'checked_val'}, { name: 'enabled', attr: 'checked_val'} ],
item: function(values) {
let type_output = '';
switch(String(values.type)){
@@ -410,6 +414,8 @@ function loadPromptsList(values){
__MSG_customPrompts_form_label_need_custom_text__
+ __MSG_customPrompts_form_label_define_response_lang__
+
__MSG_customPrompts_form_label_enabled__
@@ -547,6 +553,7 @@ function checkSelectedBoxes(checkboxes = null) {
...document.querySelectorAll('.need_selected[type="checkbox"]'),
...document.querySelectorAll('.need_signature[type="checkbox"]'),
...document.querySelectorAll('.need_custom_text[type="checkbox"]'),
+ ...document.querySelectorAll('.define_response_lang[type="checkbox"]'),
...document.querySelectorAll('.enabled[type="checkbox"]'),
];
}