showing a warning message if sparks is not present. see #182
This commit is contained in:
parent
5ea13e6443
commit
decb529cb0
4 changed files with 29 additions and 3 deletions
|
|
@ -990,5 +990,13 @@
|
||||||
"prefs_OptionText_GetCalendarEvent_infoline2": {
|
"prefs_OptionText_GetCalendarEvent_infoline2": {
|
||||||
"message": "You can change the prompt as you wish, but the response received from the AI must be in JSON format as specified in the default prompt!",
|
"message": "You can change the prompt as you wish, but the response received from the AI must be in JSON format as specified in the default prompt!",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
},
|
||||||
|
"prefs_OptionText_get_calendar_event_Sparks_not_present": {
|
||||||
|
"message": "To use the calendar event feature, please install the ThunderAI Sparks addon.",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"prefs_OptionText_download_now": {
|
||||||
|
"message": "Download ThunderAI Sparks now!",
|
||||||
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -118,6 +118,12 @@ tr.conntype_google_gemini_api, tr.conntype_google_gemini_api2{
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#no_sparks td{
|
||||||
|
text-align: center;
|
||||||
|
padding: 1em !important;
|
||||||
|
background: #bbf7f1;
|
||||||
|
}
|
||||||
|
|
||||||
textarea.option-textarea{
|
textarea.option-textarea{
|
||||||
width: -moz-available;
|
width: -moz-available;
|
||||||
height: 10em;
|
height: 10em;
|
||||||
|
|
@ -244,4 +250,7 @@ input.option-input[type="text"]{
|
||||||
background-color: rgb(2, 0, 100);
|
background-color: rgb(2, 0, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#no_sparks td{
|
||||||
|
background: #3b514f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -344,6 +344,12 @@
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="get_calendar_event_tr" id="no_sparks">
|
||||||
|
<td colspan="2">
|
||||||
|
<span>__MSG_prefs_OptionText_get_calendar_event_Sparks_not_present__</span>
|
||||||
|
<br><a href="https://addons.thunderbird.net/it/thunderbird/addon/thunderai-sparks">__MSG_prefs_OptionText_download_now__</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:20em"><label>
|
<td style="width:20em"><label>
|
||||||
<span>__MSG_Debug__</span>
|
<span>__MSG_Debug__</span>
|
||||||
|
|
|
||||||
|
|
@ -262,14 +262,17 @@ function disable_AddTags(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function disable_GetCalendarEvent(){
|
async function disable_GetCalendarEvent(){
|
||||||
let get_calendar_event = document.getElementById('get_calendar_event');
|
let get_calendar_event = document.getElementById('get_calendar_event');
|
||||||
|
let no_sparks_tr = document.getElementById('no_sparks');
|
||||||
|
let is_spark_present = await checkSparksPresence()
|
||||||
let conntype_select = document.getElementById("connection_type");
|
let conntype_select = document.getElementById("connection_type");
|
||||||
get_calendar_event.disabled = (conntype_select.value === "chatgpt_web");
|
get_calendar_event.disabled = (conntype_select.value === "chatgpt_web") || !is_spark_present;
|
||||||
let get_calendar_event_tr_elements = document.querySelectorAll('.get_calendar_event_tr');
|
let get_calendar_event_tr_elements = document.querySelectorAll('.get_calendar_event_tr');
|
||||||
get_calendar_event_tr_elements.forEach(get_calendar_event_tr => {
|
get_calendar_event_tr_elements.forEach(get_calendar_event_tr => {
|
||||||
get_calendar_event_tr.style.display = (get_calendar_event.disabled) ? 'none' : 'table-row';
|
get_calendar_event_tr.style.display = get_calendar_event.disabled ? 'none' : 'table-row';
|
||||||
});
|
});
|
||||||
|
no_sparks_tr.style.display = is_spark_present ? 'none' : 'table-row';
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue