mirror of
https://github.com/lencx/ChatGPT.git
synced 2024-10-01 01:06:13 -04:00
chore: doc
This commit is contained in:
parent
4df09113b5
commit
e524f12b6a
@ -158,6 +158,7 @@ yarn build
|
|||||||
## ❤️ 感谢
|
## ❤️ 感谢
|
||||||
|
|
||||||
- 分享按钮的代码从 [@liady](https://github.com/liady) 的插件获得,并做了一些本地化修改
|
- 分享按钮的代码从 [@liady](https://github.com/liady) 的插件获得,并做了一些本地化修改
|
||||||
|
- 感谢 [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) 项目为这个应用自定义指令功能所带来的启发
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ yarn build
|
|||||||
## ❤️ Thanks
|
## ❤️ Thanks
|
||||||
|
|
||||||
- The core implementation of the share button code was copied from the [@liady](https://github.com/liady) extension with some modifications.
|
- The core implementation of the share button code was copied from the [@liady](https://github.com/liady) extension with some modifications.
|
||||||
<!-- - [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) -->
|
- Thanks to the [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) repository for inspiring the custom command function for this application.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
## v0.4.0
|
## v0.4.0
|
||||||
|
|
||||||
feat: menu enhancement
|
feat:
|
||||||
- hide application icons from the Dock (support macOS only)
|
- customize the ChatGPT prompts command (https://github.com/lencx/ChatGPT#-announcement)
|
||||||
|
- menu enhancement: hide application icons from the Dock (support macOS only)
|
||||||
|
|
||||||
## v0.3.0
|
## v0.3.0
|
||||||
|
|
||||||
|
27
src-tauri/src/assets/cmd.js
vendored
27
src-tauri/src/assets/cmd.js
vendored
@ -1,3 +1,5 @@
|
|||||||
|
// *** Core Script - CMD ***
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
const styleDom = document.createElement('style');
|
const styleDom = document.createElement('style');
|
||||||
styleDom.innerHTML = `form {
|
styleDom.innerHTML = `form {
|
||||||
@ -66,22 +68,6 @@ async function cmdTip() {
|
|||||||
const itemDom = (v) => `<div class="cmd-item" data-prompt="${encodeURIComponent(v.prompt)}"><b>/${v.cmd}</b><i>${v.act}</i></div>`;
|
const itemDom = (v) => `<div class="cmd-item" data-prompt="${encodeURIComponent(v.prompt)}"><b>/${v.cmd}</b><i>${v.act}</i></div>`;
|
||||||
const searchInput = document.querySelector('form textarea');
|
const searchInput = document.querySelector('form textarea');
|
||||||
|
|
||||||
// const handle = debounce(function() {
|
|
||||||
// console.log('«70» /src/assets/cmd.js ~> ', 5667);
|
|
||||||
|
|
||||||
// const query = this.value;
|
|
||||||
// console.log(query);
|
|
||||||
// if (!query || !/^\//.test(query)) {
|
|
||||||
// modelDom.innerHTML = '';
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// const result = data.filter(i => i.enable && new RegExp(query.substring(1)).test(i.cmd));
|
|
||||||
// if (result.length > 0) {
|
|
||||||
// modelDom.innerHTML = `<div>${result.map(itemDom).join('')}</div>`;
|
|
||||||
// }
|
|
||||||
// }, 250);
|
|
||||||
|
|
||||||
|
|
||||||
// Enter a command starting with `/` and press a space to automatically fill `chatgpt prompt`.
|
// Enter a command starting with `/` and press a space to automatically fill `chatgpt prompt`.
|
||||||
// If more than one command appears in the search results, the first one will be used by default.
|
// If more than one command appears in the search results, the first one will be used by default.
|
||||||
searchInput.addEventListener('keydown', (event) => {
|
searchInput.addEventListener('keydown', (event) => {
|
||||||
@ -102,7 +88,6 @@ async function cmdTip() {
|
|||||||
|
|
||||||
searchInput.addEventListener('input', (event) => {
|
searchInput.addEventListener('input', (event) => {
|
||||||
const query = searchInput.value;
|
const query = searchInput.value;
|
||||||
// console.log(query);
|
|
||||||
if (!query || !/^\//.test(query)) {
|
if (!query || !/^\//.test(query)) {
|
||||||
modelDom.innerHTML = '';
|
modelDom.innerHTML = '';
|
||||||
return;
|
return;
|
||||||
@ -155,14 +140,6 @@ async function cmdTip() {
|
|||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
function debounce(fn, delay) {
|
|
||||||
let timeoutId;
|
|
||||||
return function(...args) {
|
|
||||||
clearTimeout(timeoutId);
|
|
||||||
timeoutId = setTimeout(() => fn.apply(this, args), delay);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
document.readyState === "complete" ||
|
document.readyState === "complete" ||
|
||||||
document.readyState === "interactive"
|
document.readyState === "interactive"
|
||||||
|
Loading…
Reference in New Issue
Block a user