chore: locales

This commit is contained in:
lencx
2024-02-18 15:54:37 +08:00
parent e4d4f3ed72
commit 78f33dda41
17 changed files with 155 additions and 16 deletions

View File

@@ -9,7 +9,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio
<!-- EXTENSIONS_START -->
| Name | Version | Description |
| --- | --- | --- |
| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.3 | The best assistant for batch asking and quick typing of prompts. |
| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.4 | The best assistant for batch asking and quick typing of prompts. |
| [@noi/ask-custom](https://github.com/lencx/Noi/tree/main/extensions/noi-ask-custom) | 0.1.0 | The best assistant for batch asking and quick typing of prompts. |
| [@noi/export-chatgpt](https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt) | 0.1.0 | ChatGPT chat history export, supports PDF, Image, and Markdown formats. |
| [@noi/reset](https://github.com/lencx/Noi/tree/main/extensions/noi-reset) | 0.1.0 | Reset certain website styles to enhance compatibility with Noi. |

View File

@@ -19,6 +19,13 @@ class NoiAsk {
}
}
static autoFocus() {
const inputElement = document.querySelector('textarea');
if (inputElement) {
inputElement.focus();
}
}
static simulateUserInput(element, text) {
const inputEvent = new InputEvent('input', {
bubbles: true,
@@ -69,6 +76,10 @@ class ClaudeAsk extends NoiAsk {
}
}
static autoFocus() {
this.sync('');
}
static submit() {
// subsequent screens use this
let btn = document.querySelector('button[aria-label*="Send Message"]');
@@ -97,6 +108,13 @@ class GeminiAsk extends NoiAsk {
}
}
static autoFocus() {
const inputElement = document.querySelector('.ql-editor.textarea');
if (inputElement) {
inputElement.focus();
}
}
static submit() {
const btn = document.querySelector('button[aria-label*="Send message"]');
if (btn) {
@@ -120,6 +138,13 @@ class HuggingChatAsk extends NoiAsk {
}
}
static autoFocus() {
var inputElement = document.querySelector('textarea[placeholder*="Ask anything"]');
if (inputElement) {
inputElement.focus();
}
}
static submit() {
var btn = document.querySelector('form.relative > div > button[type="submit"]');
if (btn) this.autoClick(btn);
@@ -158,6 +183,16 @@ class CopilotAsk extends NoiAsk {
}
}
static autoFocus() {
const serpDOM = document.querySelector('.cib-serp-main');
const inputDOM = serpDOM.shadowRoot.querySelector('#cib-action-bar-main');
const textInputDOM = inputDOM.shadowRoot.querySelector('cib-text-input');
const inputElement = textInputDOM ? textInputDOM.shadowRoot.querySelector('#searchbox') : inputDOM.shadowRoot.querySelector('#searchbox');
if (inputElement) {
inputElement.focus();
}
}
static submit() {
try {
// Access SERP Shadow DOM

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "@noi/ask",
"version": "0.1.3",
"version": "0.1.4",
"homepage": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask",
"description": "The best assistant for batch asking and quick typing of prompts.",
"content_scripts": [

View File

@@ -5,7 +5,7 @@
{
"name": "@noi/ask",
"description": "The best assistant for batch asking and quick typing of prompts.",
"version": "0.1.3",
"version": "0.1.4",
"url": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask",
"dirname": "noi-ask",
"disabled": false