add hyprland warning when using linux. fixes #318

This commit is contained in:
mic 2025-04-03 21:49:57 +02:00
parent b3bb3627cb
commit 3011def9f1
3 changed files with 19 additions and 5 deletions

View file

@ -174,7 +174,11 @@ input.option-input[type="text"]{
display: none;
}
#owl_warning div{
#hyprland_warning{
display: none;
}
.warning{
color: white;
font-style: italic;
background-color: red;
@ -184,7 +188,7 @@ input.option-input[type="text"]{
margin-bottom: 5px;
}
#owl_warning div a{
.warning a{
background-color: white;
padding:0px 3px;
border-radius: 4px;

View file

@ -12,10 +12,13 @@
<td colspan="2"><div>__MSG_prefs_SurveyLinkText__<br><a href="https://forms.gle/1qK2wcbuhaRzhwyt9">__MSG_prefs_SurveyLinkText2__</a></div></td>
</tr>
<tr id="owl_warning">
<td colspan="2"><div>__MSG_prefs_OptionText_owl_warning__ <a href="https://micz.it/thunderbird-addon-thunderai/owl/">__MSG_customPrompts_managePrompts_help__</a></div></td>
<td colspan="2"><div class="warning">__MSG_prefs_OptionText_owl_warning__ <a href="https://micz.it/thunderbird-addon-thunderai/owl/">__MSG_customPrompts_managePrompts_help__</a></div></td>
</tr>
<tr id="hyprland_warning">
<td colspan="2" style="text-align:center;" class="warning"><b>Set height and width to 0 if you're using hyprland!</b></td>
</tr>
<tr>
<td><span>__MSG_prefs_OptionText_chatgpt_win_text__</span></td>
<td><span>__MSG_prefs_OptionText_chatgpt_win_text__</span>
<td>
<label>
<span class="dims_label">__MSG_prefs_OptionText_chatgpt_win_height__</span>

View file

@ -455,7 +455,7 @@ document.addEventListener('DOMContentLoaded', async () => {
document.getElementById("openai_comp_host").addEventListener("change", warn_OpenAIComp_HostEmpty);
document.getElementById("google_gemini_api_key").addEventListener("change", warn_GoogleGemini_APIKeyEmpty);
let prefs = await browser.storage.sync.get({chatgpt_model: '', ollama_model: '', openai_comp_model: '', google_gemini_model: ''});
let prefs = await browser.storage.sync.get({chatgpt_model: '', ollama_model: '', openai_comp_model: '', google_gemini_model: '', chatgpt_win_height: 0, chatgpt_win_width: 0 });
// OpenAI API ChatGPT model fetching
let select_chatgpt_model = document.getElementById('chatgpt_model');
@ -683,4 +683,11 @@ document.addEventListener('DOMContentLoaded', async () => {
browser.tabs.create({ url: 'https://chatgpt.com/' });
});
browser.runtime.getPlatformInfo().then(info => {
taLog.log("OS: " + info.os);
if ((info.os === "linux")&&(prefs.chatgpt_win_height!=0)&&(prefs.chatgpt_win_width!=0)){
document.getElementById('hyprland_warning').style.display = 'table-row';
}
});
}, { once: true });