change icon etx
This commit is contained in:
23
sidepanel.js
23
sidepanel.js
@@ -9,9 +9,28 @@ const sendCustomBtn = document.getElementById('sendCustom');
|
||||
const statusBadge = document.getElementById('statusBadge');
|
||||
const resultsArea = document.getElementById('results');
|
||||
|
||||
// Collapsible logic
|
||||
const toggleConfig = document.getElementById('toggleConfig');
|
||||
const configContent = document.getElementById('configContent');
|
||||
const configChevron = document.getElementById('configChevron');
|
||||
|
||||
toggleConfig.addEventListener('click', () => {
|
||||
const isHidden = configContent.classList.toggle('hidden');
|
||||
configChevron.classList.toggle('rotate-180', !isHidden);
|
||||
});
|
||||
|
||||
// Load settings on startup
|
||||
chrome.storage.local.get(['geminiApiKey', 'googleScriptUrl'], (data) => {
|
||||
if (data.geminiApiKey) apiKeyInput.value = data.geminiApiKey;
|
||||
if (data.geminiApiKey) {
|
||||
apiKeyInput.value = data.geminiApiKey;
|
||||
// Fold by default if already configured
|
||||
configContent.classList.add('hidden');
|
||||
configChevron.classList.remove('rotate-180');
|
||||
} else {
|
||||
// Expand if no API key
|
||||
configContent.classList.remove('hidden');
|
||||
configChevron.classList.add('rotate-180');
|
||||
}
|
||||
if (data.googleScriptUrl) scriptUrlInput.value = data.googleScriptUrl;
|
||||
});
|
||||
|
||||
@@ -92,7 +111,7 @@ Title: ${pageData.title}`;
|
||||
}
|
||||
|
||||
async function callGemini(apiKey, systemPrompt, contextText, userPrompt) {
|
||||
const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=${apiKey}`;
|
||||
const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-lite:generateContent?key=${apiKey}`;
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user