-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
154 lines (149 loc) Β· 8.87 KB
/
popup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title data-i18n="extensionName"></title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="card">
<div class="container">
<header class="header">
<img src="images/icon.png" alt="Typollama Icon" class="icon">
<h1 class="title">Typollama</h1>
</header>
<h3 class="subheading" data-i18n="aiSpellcheckTitle">AI Spell-Check & Text Processing</h3>
<a href="https://github.com/adamtash/typollama" target="_blank" class="github-link" data-i18n="aboutDocumentation">About & Documentation β</a>
<div id="errorContainer" class="error-message"></div>
<div class="provider-select-wrapper">
<label for="providerSelect" data-i18n="providerLabel"></label>
<select id="providerSelect">
<option value="ollama" data-i18n="ollamaProvider">Ollama</option>
<option value="openai" data-i18n="openaiProvider">OpenAI</option>
<option value="anthropic" data-i18n="anthropicProvider">Anthropic Claude</option>
<option value="lmstudio" data-i18n="lmstudioProvider">LM Studio</option>
<option value="gemini" data-i18n="geminiProvider">Google Gemini</option>
<option value="deepseek" data-i18n="deepseekProvider">DeepSeek</option>
<option value="mistral" data-i18n="mistralProvider">Mistral AI</option>
<option value="perplexity" data-i18n="perplexityProvider">Perplexity AI</option>
<option value="chrome" data-i18n="chromeProvider">Chrome AI (Preview)</option>
</select>
</div>
<div id="providerDocs">
<div id="ollamaDocs" style="display:none;">
<a href="https://github.com/ollama/ollama" target="_blank" data-i18n="ollamaDocsLink">Ollama Documentation β</a>
</div>
<div id="openaiDocs" style="display:none;">
<a href="https://platform.openai.com/docs" target="_blank" data-i18n="openaiDocsLink">OpenAI Documentation β</a>
</div>
<div id="anthropicDocs" style="display:none;">
<a href="https://console.anthropic.com/settings/keys" target="_blank" data-i18n="anthropicDocsLink">Get Claude API Key β</a>
</div>
<div id="lmstudioDocs" style="display:none;">
<a href="https://lmstudio.ai/docs" target="_blank" data-i18n="lmstudioDocsLink">LM Studio Documentation β</a>
</div>
<div id="geminiDocs" style="display:none;">
<a href="https://aistudio.google.com/app/apikey" target="_blank" data-i18n="geminiDocsLink">Get your FREE Google Gemini API Key β</a>
</div>
<div id="deepseekDocs" style="display:none;">
<a href="https://platform.deepseek.com/api_keys" target="_blank" data-i18n="deepseekDocsLink">Get DeepSeek API Key β</a>
</div>
<div id="mistralDocs" style="display:none;">
<a href="https://console.mistral.ai/api-keys/" target="_blank" data-i18n="mistralDocsLink">Get Mistral API Key β</a>
</div>
<div id="perplexityDocs" style="display:none;">
<a href="https://www.perplexity.ai/settings/api" target="_blank" data-i18n="perplexityDocsLink">Get Perplexity API Key β</a>
</div>
<div id="chromeDocs" style="display:none;">
<a href="https://developer.chrome.com/docs/ai/get-started" target="_blank" data-i18n="chromeDocsLink">Chrome AI Documentation β</a>
</div>
</div>
<div id="chromeAiNote" style="display:none; font-size: 0.8rem; margin-top: 5px;">
<i data-i18n="chromeAiNoteText">Note: Chrome AI is a preview feature. To use it, you need to enable the feature flag in Chrome:</i>
<br>
<a href="chrome://flags/#prompt-api-for-gemini-nano" target="_blank" data-i18n="chromeAiEnableLink">Enable Chrome AI feature flag</a>
</div>
<div class="provider-group">
<input id="openAiKeyInput" type="password" placeholder="OpenAI API Key" style="display: none;" data-i18n-placeholder="openAiKeyPlaceholder" />
<input id="anthropicKeyInput" type="password" placeholder="Anthropic API Key" style="display: none;" data-i18n-placeholder="anthropicKeyPlaceholder" />
<input id="geminiKeyInput" type="password" placeholder="Google API Key" style="display: none;" data-i18n-placeholder="geminiKeyPlaceholder" />
<input id="deepseekKeyInput" type="password" placeholder="DeepSeek API Key" style="display: none;" data-i18n-placeholder="deepseekKeyPlaceholder" />
<input id="mistralKeyInput" type="password" placeholder="Mistral AI API Key" style="display: none;" data-i18n-placeholder="mistralKeyPlaceholder" />
<input id="perplexityKeyInput" type="password" placeholder="Perplexity AI API Key" style="display: none;" data-i18n-placeholder="perplexityKeyPlaceholder" />
<div class="url-input-container">
<div class="input-with-reset">
<input id="ollamaUrlInput" type="text" placeholder="Ollama URL" data-i18n-placeholder="ollamaUrlPlaceholder" />
<button id="resetOllamaUrl" class="reset-button" type="button" style="display: none;" data-i18n="resetButton">Reset</button>
</div>
<div class="input-with-reset" style="display: none;">
<input id="lmstudioUrlInput" type="text" placeholder="LM Studio URL" data-i18n-placeholder="lmstudioUrlPlaceholder" />
<button id="resetLmstudioUrl" class="reset-button" type="button" style="display: none;" data-i18n="resetButton">Reset</button>
</div>
</div>
<label id="modelNameLabel" for="modelNameInput" data-i18n="modelNameLabel">Model Name:</label>
<div>
<div class="input-with-reset">
<input id="modelNameInput" type="text" placeholder="Model Name" data-i18n-placeholder="modelNamePlaceholder" />
<button id="resetModelName" class="reset-button" type="button" style="display: none;" data-i18n="resetButton">Reset</button>
</div>
</div>
</div>
<div class="advanced-settings">
<button type="button" class="advanced-toggle collapsed" id="advancedToggle" data-i18n="advancedSettingsLabel">
Advanced Settings
</button>
<div class="advanced-content collapsed" id="advancedContent">
<div class="prompt-settings-group">
<h3 data-i18n="writingToolsTitle">Writing Tools</h3>
<div>
<select id="promptTypeSelect">
<option value="spellcheck" data-i18n="spellcheckOption">Spellcheck</option>
<option value="proofread" data-i18n="proofreadOption">Rewrite</option>
<option value="custom" data-i18n="customAiEditorOption">Custom AI Editor</option>
</select>
</div>
<div>
<textarea id="systemPromptInput" rows="8" placeholder="System Prompt"
style="width: 100%; resize: vertical;"></textarea>
<button id="resetPrompt" class="reset-button" type="button" data-i18n="resetButton" style="display: none;">Reset</button>
</div>
<fieldset id="shortcutModeFieldset">
<legend data-i18n="shortcutModeLabel">Shortcut Mode</legend>
<div class="shortcut-radio-group">
<label>
<input type="radio" name="shortcutMode" value="double_stroke" data-prompt-type="spellcheck" />
<span data-i18n="doubleCtrlStroke">Double CTRL Stroke</span>
</label>
<label>
<input type="radio" name="shortcutMode" value="triple_stroke" data-prompt-type="proofread" />
<span data-i18n="tripleCtrlStroke">Triple CTRL Stroke</span>
</label>
<label>
<input type="radio" name="shortcutMode" value="quadruple_stroke" data-prompt-type="custom" />
<span data-i18n="quadrupleCtrlStroke">Quadruple CTRL Stroke</span>
</label>
<label>
<input type="radio" name="shortcutMode" value="custom" data-prompt-type="spellcheck" />
<span data-i18n="customShortcutKey">Custom Shortcut Key</span>
</label>
</div>
</fieldset>
<label id="customShortcutLabel" style="display:none;">
Custom Shortcut:
<input id="customShortcutInput" type="text" readonly placeholder="Press 'Record' to capture"
style="width:100%;" />
<button id="recordShortcut" type="button" style="width: auto;">Record Shortcut</button>
</label>
</div>
<label>
<input id="copyToClipboard" type="checkbox" />
<span data-i18n="copyToClipboardLabel">Copy result to clipboard only (no in-place edit)</span>
</label>
</div>
</div>
</div>
</div>
<script type="module" src="popup.js"></script>
</body>
</html>