diff --git a/README-ZH_CN.md b/README-ZH_CN.md index afdc57f..f01c1c2 100644 --- a/README-ZH_CN.md +++ b/README-ZH_CN.md @@ -158,6 +158,7 @@ yarn build ## ❤️ 感谢 - 分享按钮的代码从 [@liady](https://github.com/liady) 的插件获得,并做了一些本地化修改 +- 感谢 [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) 项目为这个应用自定义指令功能所带来的启发 --- diff --git a/README.md b/README.md index 4735f36..948d69a 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ yarn build ## ❤️ Thanks - The core implementation of the share button code was copied from the [@liady](https://github.com/liady) extension with some modifications. - +- Thanks to the [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) repository for inspiring the custom command function for this application. --- diff --git a/UPDATE_LOG.md b/UPDATE_LOG.md index 4d2f012..f2bda9b 100644 --- a/UPDATE_LOG.md +++ b/UPDATE_LOG.md @@ -2,8 +2,9 @@ ## v0.4.0 -feat: menu enhancement -- hide application icons from the Dock (support macOS only) +feat: +- 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 diff --git a/src-tauri/src/assets/cmd.js b/src-tauri/src/assets/cmd.js index a8d7273..97cb6bc 100644 --- a/src-tauri/src/assets/cmd.js +++ b/src-tauri/src/assets/cmd.js @@ -1,3 +1,5 @@ +// *** Core Script - CMD *** + function init() { const styleDom = document.createElement('style'); styleDom.innerHTML = `form { @@ -66,22 +68,6 @@ async function cmdTip() { const itemDom = (v) => `
/${v.cmd}${v.act}
`; 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 = `
${result.map(itemDom).join('')}
`; - // } - // }, 250); - - // 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. searchInput.addEventListener('keydown', (event) => { @@ -102,7 +88,6 @@ async function cmdTip() { searchInput.addEventListener('input', (event) => { const query = searchInput.value; - // console.log(query); if (!query || !/^\//.test(query)) { modelDom.innerHTML = ''; return; @@ -155,14 +140,6 @@ async function cmdTip() { }, 200); } -function debounce(fn, delay) { - let timeoutId; - return function(...args) { - clearTimeout(timeoutId); - timeoutId = setTimeout(() => fn.apply(this, args), delay); - }; -} - if ( document.readyState === "complete" || document.readyState === "interactive"