This commit is contained in:
parent
2195d03f98
commit
bdd4d7ffc7
3 changed files with 6 additions and 3 deletions
|
|
@ -411,6 +411,9 @@ export async function checkSparksPresence() {
|
|||
}
|
||||
}
|
||||
|
||||
export function validateChatGPTWebCustomData(data) {
|
||||
return data.startsWith('/g/') || data == '';
|
||||
}
|
||||
|
||||
// The following methods are a modified version derived from https://github.com/ali-raheem/Aify/blob/13ff87583bc520fb80f555ab90a90c5c9df797a7/plugin/content_scripts/compose.js
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@
|
|||
</tr>
|
||||
<tr class="conntype_chatgpt_web">
|
||||
<td><label>
|
||||
<span class="opt_title">__MSG_OpenChatGPTTab_Info__</span>
|
||||
<span>__MSG_OpenChatGPTTab_Info__</span>
|
||||
</label></td>
|
||||
<td>
|
||||
<button id="btnChatGPTWeb_Tab">__MSG_OpenChatGPTTab__</button>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import { OpenAI } from '../js/api/openai.js';
|
|||
import { Ollama } from '../js/api/ollama.js';
|
||||
import { OpenAIComp } from '../js/api/openai_comp.js'
|
||||
import { GoogleGemini } from '../js/api/google_gemini.js';
|
||||
import { checkSparksPresence, isThunderbird128OrGreater, openTab } from '../js/mzta-utils.js';
|
||||
import { checkSparksPresence, isThunderbird128OrGreater, openTab, validateChatGPTWebCustomData } from '../js/mzta-utils.js';
|
||||
|
||||
let taLog = new taLogger("mzta-options",true);
|
||||
let _isThunderbird128OrGreater = true;
|
||||
|
|
@ -314,7 +314,7 @@ async function disable_GetCalendarEvent(){
|
|||
}
|
||||
|
||||
function validateCustomData_ChatGPTWeb(event) {
|
||||
let is_valid = event.target.value.startsWith('/g/') || event.target.value == '';
|
||||
let is_valid = validateChatGPTWebCustomData(event.target.value);
|
||||
event.target.style.borderColor = is_valid ? 'green' : 'red';
|
||||
document.getElementById(event.target.id + '_info').style.color = is_valid ? '' : 'red';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue