action only text for defaults prompts

This commit is contained in:
mic 2024-05-12 23:15:58 +02:00
parent 91568bace7
commit 3f3ee14d9c
3 changed files with 38 additions and 9 deletions

View file

@ -89,6 +89,21 @@
"description": "" "description": ""
}, },
"customPrompts_close_button": {
"message": "Close button",
"description": ""
},
"customPrompts_do_reply": {
"message": "Do reply",
"description": ""
},
"customPrompts_substitute_text": {
"message": "Substitute text",
"description": ""
},
"chatgpt_win_working": { "chatgpt_win_working": {
"message": "Work in progress...", "message": "Work in progress...",
"description": "" "description": ""

View file

@ -33,9 +33,9 @@
<br> <br>
<label for="selectActionNew">Action:</label> <label for="selectActionNew">Action:</label>
<select id="selectActionNew" name="action"> <select id="selectActionNew" name="action">
<option value="0">Close button</option> <option value="0">__MSG_customPrompts_close_button__</option>
<option value="1">Do reply</option> <option value="1">__MSG_customPrompts_do_reply__</option>
<option value="2">Substitute text</option> <option value="2">__MSG_customPrompts_substitute_text__</option>
</select> </select>
<br> <br>
<label for="selectNeedSelectedNew">Need selection:</label> <label for="selectNeedSelectedNew">Need selection:</label>

View file

@ -41,6 +41,19 @@ document.addEventListener('DOMContentLoaded', async () => {
break; break;
} }
let action_output = '';
switch(values.action){
case 0:
action_output = `<span>__MSG_customPrompts_close_button__</span>`;
break;
case 1:
action_output = `<span>__MSG_customPrompts_save_button__</span>`;
break;
case 2:
action_output = `<span>__MSG_customPrompts_do_reply__</span>`;
break;
}
let output = `<tr ` + ((values.is_default == 1) ? 'class="is_default"':'') + `> let output = `<tr ` + ((values.is_default == 1) ? 'class="is_default"':'') + `>
<td class="id"></td> <td class="id"></td>
<td class="name"></td> <td class="name"></td>
@ -54,12 +67,13 @@ document.addEventListener('DOMContentLoaded', async () => {
`<span class="type hiddendata"></span> `<span class="type hiddendata"></span>
</td> </td>
<td class="properties"> <td class="properties">
Action: <select class="input_mod"` + ((values.is_default == 1) ? ' disabled':'') + `> Action: ` + ((values.is_default == 1) ? action_output :
<option value="0"` + ((values.action == 0) ? ' selected':'') + `>Close button</option> `<select class="input_mod">
<option value="1"` + ((values.action == 1) ? ' selected':'') + `>Do reply</option> <option value="0"` + ((values.action == 0) ? ' selected':'') + `>__MSG_customPrompts_close_button__</option>
<option value="2"` + ((values.action == 2) ? ' selected':'') + `>Substitute text</option> <option value="1"` + ((values.action == 1) ? ' selected':'') + `>__MSG_customPrompts_do_reply__</option>
</select> <option value="2"` + ((values.action == 2) ? ' selected':'') + `>__MSG_customPrompts_substitute_text__</option>
<span class="action hiddendata"></span> </select>`) +
`<span class="action hiddendata"></span>
<br> <br>
<input type="checkbox" class="need_selected input_mod"` + ((values.is_default == 1) ? ' disabled':'') + `> Need Select <input type="checkbox" class="need_selected input_mod"` + ((values.is_default == 1) ? ' disabled':'') + `> Need Select
<br> <br>