From 0dc06ace12094779914b309e166beb20974ea9df Mon Sep 17 00:00:00 2001 From: joe <> Date: Sun, 7 May 2023 17:11:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=9B=9E=E8=A6=86=E5=BE=9E5?= =?UTF-8?q?=E7=B5=84=E5=A2=9E=E5=8A=A0=E5=88=B050=E7=B5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/content.js | 533 ++++++++++++++++++++++++++------------------------ 1 file changed, 278 insertions(+), 255 deletions(-) diff --git a/js/content.js b/js/content.js index f46e602..ad6e312 100644 --- a/js/content.js +++ b/js/content.js @@ -40,8 +40,9 @@ function restoreMenuItemTabindex() { } function downloadHtml() { - const container = - document.querySelector("main")?.querySelector('.overflow-hidden').children[0].children[0]; + const container = document + .querySelector("main") + ?.querySelector(".overflow-hidden").children[0].children[0]; const clonedContainer = container.cloneNode(true); const avatarList = clonedContainer.querySelectorAll("img.rounded-sm"); const buttons = clonedContainer.querySelectorAll("button"); @@ -66,8 +67,7 @@ function downloadHtml() { const styles = Array.from(document.styleSheets) .filter( (styleSheet) => - !styleSheet.href || - styleSheet.href.startsWith(window.location.origin) + !styleSheet.href || styleSheet.href.startsWith(window.location.origin) ) .map((styleSheet) => Array.from(styleSheet.cssRules) @@ -585,7 +585,25 @@ const defaultPromptListKO = [ ]; // defaultQuickReply 多國語系 -const defaultQuickReplyMessageListTW = [ + +const QuickReplyMessageAllItems = 50; + +let DefaultEmptyQuickReplyMessageList = []; + +Array.from({ length: QuickReplyMessageAllItems }).forEach((_, index) => { + if (index > 4) { + DefaultEmptyQuickReplyMessageList.push({ + key: "none", + text: "quickReply" + (index + 1), + quickReplyMessage: "", + buttonElement: null, + handleClickFn: null, + isVisible: false, + }); + } +}); + +let defaultQuickReplyMessageListTW = [ { key: "Y", text: "提供其它範例", @@ -625,10 +643,14 @@ const defaultQuickReplyMessageListTW = [ buttonElement: null, handleClickFn: null, isVisible: true, - }, + } +]; +defaultQuickReplyMessageListTW = [ + ...defaultQuickReplyMessageListTW, + ...DefaultEmptyQuickReplyMessageList ]; -const defaultQuickReplyMessageListJA = [ +let defaultQuickReplyMessageListJA = [ { key: "Y", text: "他の例", @@ -670,8 +692,12 @@ const defaultQuickReplyMessageListJA = [ isVisible: true, }, ]; +defaultQuickReplyMessageListJA = [ + ...defaultQuickReplyMessageListJA, + ...DefaultEmptyQuickReplyMessageList +]; -const defaultQuickReplyMessageListEN = [ +let defaultQuickReplyMessageListEN = [ { key: "Y", text: "Other examples", @@ -713,8 +739,12 @@ const defaultQuickReplyMessageListEN = [ isVisible: true, }, ]; +defaultQuickReplyMessageListEN = [ + ...defaultQuickReplyMessageListEN, + ...DefaultEmptyQuickReplyMessageList +]; -const defaultQuickReplyMessageListCN = [ +let defaultQuickReplyMessageListCN = [ { key: "Y", text: "提供其他示例", @@ -756,8 +786,12 @@ const defaultQuickReplyMessageListCN = [ isVisible: true, }, ]; +defaultQuickReplyMessageListCN = [ + ...defaultQuickReplyMessageListCN, + ...DefaultEmptyQuickReplyMessageList +]; -const defaultQuickReplyMessageListKO = [ +let defaultQuickReplyMessageListKO = [ { key: "Y", text: "다른 예시 제공", @@ -799,6 +833,10 @@ const defaultQuickReplyMessageListKO = [ isVisible: true, }, ]; +defaultQuickReplyMessageListKO = [ + ...defaultQuickReplyMessageListKO, + ...DefaultEmptyQuickReplyMessageList +]; // defaultSuperPromptList 多國語系 @@ -1179,7 +1217,21 @@ function findGroupAndIndex(promptId) { } .custom-menu .quick-reply-area{ margin-top:5px; - flex:0 0 180px; + flex: 0 0 auto; + max-height: 380px; + overflow-y: auto; + } + .custom-menu .other-area{ + margin-top:5px; + flex:0 0 60px; + } + .custom-menu .quick-reply-area::-webkit-scrollbar { + width: 0; + height: 0; + background-color: transparent; + } + .custom-menu .quick-reply-area .custom-template-buttons:last-child { + margin:0 !important; } .dialog-wrapper { position: fixed; @@ -1646,7 +1698,9 @@ function findGroupAndIndex(promptId) { ${i18n("table_title_shortcut")} - ${i18n("table_title_button_name")} + ${i18n( + "table_title_button_name" + )} ${i18n("table_title_prefix_text")} ${i18n("table_title_suffix_text")} ${i18n("table_title_is_show")} @@ -1657,22 +1711,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 1 + mainKeyText + )} + 1
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1687,22 +1744,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 2 + mainKeyText + )} + 2
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1717,22 +1777,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 3 + mainKeyText + )} + 3
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1747,22 +1810,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 4 + mainKeyText + )} + 4
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1777,22 +1843,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 5 + mainKeyText + )} + 5
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1807,22 +1876,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 6 + mainKeyText + )} + 6
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1837,22 +1909,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 7 + mainKeyText + )} + 7
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1867,22 +1942,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 8 + mainKeyText + )} + 8
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1897,22 +1975,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 9 + mainKeyText + )} + 9
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1927,22 +2008,25 @@ function findGroupAndIndex(promptId) {
${capitalizeFirstLetter( - mainKeyText - )} + 0 + mainKeyText + )} + 0
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
+ "placeholder_please_input" + )}">
@@ -1957,11 +2041,11 @@ function findGroupAndIndex(promptId) {