Spaces:
Running
Running
Update index.html
Browse files- index.html +26 -3
index.html
CHANGED
|
@@ -234,6 +234,7 @@ th{font-weight:600}
|
|
| 234 |
color:var(--paper-text);
|
| 235 |
font-family:'PT Mono',monospace;
|
| 236 |
font-size:13px;
|
|
|
|
| 237 |
}
|
| 238 |
.modal-buttons{
|
| 239 |
margin-top:20px;
|
|
@@ -258,6 +259,12 @@ th{font-weight:600}
|
|
| 258 |
color:var(--paper-text);
|
| 259 |
border:1px solid var(--code-border);
|
| 260 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
|
| 262 |
/* responsive & print */
|
| 263 |
@media(max-width:768px){
|
|
@@ -304,10 +311,12 @@ th{font-weight:600}
|
|
| 304 |
<div class="modal-content">
|
| 305 |
<h2>API Settings</h2>
|
| 306 |
<label for="nebiusKey">Nebius API Key:</label>
|
| 307 |
-
<input type="password" id="nebiusKey" placeholder="Enter your Nebius API key">
|
|
|
|
| 308 |
|
| 309 |
<label for="cerebrasKey">Cerebras API Key:</label>
|
| 310 |
-
<input type="password" id="cerebrasKey" placeholder="Enter your Cerebras API key">
|
|
|
|
| 311 |
|
| 312 |
<div class="modal-buttons">
|
| 313 |
<button class="btn-cancel" onclick="closeSettings()">Cancel</button>
|
|
@@ -529,8 +538,22 @@ async function processImage(file) {
|
|
| 529 |
}
|
| 530 |
}
|
| 531 |
|
| 532 |
-
/* ======= paste listener
|
| 533 |
document.addEventListener('paste', async (e) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 534 |
e.preventDefault();
|
| 535 |
|
| 536 |
// Check for image files
|
|
|
|
| 234 |
color:var(--paper-text);
|
| 235 |
font-family:'PT Mono',monospace;
|
| 236 |
font-size:13px;
|
| 237 |
+
box-sizing: border-box;
|
| 238 |
}
|
| 239 |
.modal-buttons{
|
| 240 |
margin-top:20px;
|
|
|
|
| 259 |
color:var(--paper-text);
|
| 260 |
border:1px solid var(--code-border);
|
| 261 |
}
|
| 262 |
+
.api-hint{
|
| 263 |
+
font-size:11px;
|
| 264 |
+
color:#888;
|
| 265 |
+
margin-top:3px;
|
| 266 |
+
font-style:italic;
|
| 267 |
+
}
|
| 268 |
|
| 269 |
/* responsive & print */
|
| 270 |
@media(max-width:768px){
|
|
|
|
| 311 |
<div class="modal-content">
|
| 312 |
<h2>API Settings</h2>
|
| 313 |
<label for="nebiusKey">Nebius API Key:</label>
|
| 314 |
+
<input type="password" id="nebiusKey" placeholder="Enter your Nebius API key" autocomplete="off">
|
| 315 |
+
<div class="api-hint">Used for OCR image processing</div>
|
| 316 |
|
| 317 |
<label for="cerebrasKey">Cerebras API Key:</label>
|
| 318 |
+
<input type="password" id="cerebrasKey" placeholder="Enter your Cerebras API key" autocomplete="off">
|
| 319 |
+
<div class="api-hint">Used for solving questions</div>
|
| 320 |
|
| 321 |
<div class="modal-buttons">
|
| 322 |
<button class="btn-cancel" onclick="closeSettings()">Cancel</button>
|
|
|
|
| 538 |
}
|
| 539 |
}
|
| 540 |
|
| 541 |
+
/* ======= FIXED paste listener - allows normal paste in input fields ======= */
|
| 542 |
document.addEventListener('paste', async (e) => {
|
| 543 |
+
// Check if we're pasting into an input, textarea, or contenteditable element
|
| 544 |
+
const activeElement = document.activeElement;
|
| 545 |
+
const isInputField = activeElement && (
|
| 546 |
+
activeElement.tagName === 'INPUT' ||
|
| 547 |
+
activeElement.tagName === 'TEXTAREA' ||
|
| 548 |
+
activeElement.contentEditable === 'true'
|
| 549 |
+
);
|
| 550 |
+
|
| 551 |
+
// If pasting into an input field, let the browser handle it normally
|
| 552 |
+
if (isInputField) {
|
| 553 |
+
return; // Don't prevent default, let normal paste happen
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
// Otherwise, handle custom paste logic
|
| 557 |
e.preventDefault();
|
| 558 |
|
| 559 |
// Check for image files
|