Characters list top panel touchup (#4282) * Move search bar under buttons Closes #4275 * Remove horizontal rules from right menu * Add toggle for search form * Add container for extension rm buttons * Be square or be there * Adjust font sizes * Square enlargement program * Adjust margins * Remove margin from pagination outlet buttons * Adjust margin on tag controls * Collapse 1px margins * Update public/script.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove variable assignment --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed| @@ -470,14 +470,6 @@ | |||
| 470 | margin-left: 20px; | 470 | margin-left: 20px; |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | /*used to fix smallness of certain FontAwesome glyph which break button squareness*/ | ||
| 474 | /*currently used on: CharList Import*/ | ||
| 475 | |||
| 476 | .faSmallFontSquareFix { | ||
| 477 | font-size: calc(var(--mainFontSize) *1.25); | ||
| 478 | width: calc(var(--mainFontSize) *1.95); | ||
| 479 | } | ||
| 480 | |||
| 481 | .textarea_compact { | 473 | .textarea_compact { |
| 482 | font-size: calc(var(--mainFontSize) * 0.95); | 474 | font-size: calc(var(--mainFontSize) * 0.95); |
| 483 | line-height: 1.2; | 475 | line-height: 1.2; |
| @@ -157,7 +157,7 @@ | |||
| 157 | flex-direction: row; | 157 | flex-direction: row; |
| 158 | flex-wrap: wrap; | 158 | flex-wrap: wrap; |
| 159 | align-items: flex-start; | 159 | align-items: flex-start; |
| 160 | margin: 5px; | 160 | margin: 5px 0; |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | .rm_tag_filter .tag { | 163 | .rm_tag_filter .tag { |
| @@ -5522,7 +5522,6 @@ | |||
| 5522 | <div id="HotSwapWrapper" class="alignitemscenter flex-container margin0auto wide100p"> | 5522 | <div id="HotSwapWrapper" class="alignitemscenter flex-container margin0auto wide100p"> |
| 5523 | <div class="hotswap avatars_inline scroll-reset-container expander" data-i18n="[no_favs]Favorite characters to add them to HotSwaps" no_favs="Favorite characters to add them to HotSwaps"> | 5523 | <div class="hotswap avatars_inline scroll-reset-container expander" data-i18n="[no_favs]Favorite characters to add them to HotSwaps" no_favs="Favorite characters to add them to HotSwaps"> |
| 5524 | </div> | 5524 | </div> |
| 5525 | <hr class="wide100p"> | ||
| 5526 | </div> | 5525 | </div> |
| 5527 | </div> | 5526 | </div> |
| 5528 | 5527 | ||
| @@ -5850,13 +5849,15 @@ | |||
| 5850 | </div> | 5849 | </div> |
| 5851 | <div name="Character List Panel" id="rm_characters_block" class="right_menu"> | 5850 | <div name="Character List Panel" id="rm_characters_block" class="right_menu"> |
| 5852 | <div id="charListFixedTop"> | 5851 | <div id="charListFixedTop"> |
| 5853 | <form id="form_character_search_form" action="javascript:void(null);"> | 5852 | <div id="rm_button_bar"> |
| 5854 | <div id="rm_button_create" title="Create New Character" data-i18n="[title]Create New Character" class="menu_button fa-solid fa-user-plus"></div> | 5853 | <div id="rm_button_create" title="Create New Character" data-i18n="[title]Create New Character" class="menu_button fa-solid fa-user-plus"></div> |
| 5855 | <div id="character_import_button" title="Import Character from File" data-i18n="[title]Import Character from File" class="menu_button fa-solid fa-file-import faSmallFontSquareFix"></div> | 5854 | <div id="character_import_button" title="Import Character from File" data-i18n="[title]Import Character from File" class="menu_button fa-solid fa-file-import"></div> |
| 5856 | <div id="external_import_button" title="Import content from external URL" data-i18n="[title]Import content from external URL" class="menu_button fa-solid fa-cloud-arrow-down faSmallFontSquareFix"></div> | 5855 | <div id="external_import_button" title="Import content from external URL" data-i18n="[title]Import content from external URL" class="menu_button fa-solid fa-cloud-arrow-down"></div> |
| 5857 | <div id="rm_button_group_chats" title="Create New Chat Group" data-i18n="[title]Create New Chat Group" class="menu_button fa-solid fa-users-gear"></div> | 5856 | <div id="rm_button_group_chats" title="Create New Chat Group" data-i18n="[title]Create New Chat Group" class="menu_button fa-solid fa-users-gear"></div> |
| 5858 | <input id="character_search_bar" class="text_pole width100p" type="search" data-i18n="[placeholder]Search..." placeholder="Search..." /> | 5857 | <div id="rm_buttons_container"> |
| 5859 | <select id="character_sort_order" title="Characters sorting order" data-i18n="[title]Characters sorting order"> | 5858 | <!-- Container for additional buttons added by extensions --> |
| 5859 | </div> | ||
| 5860 | <select id="character_sort_order" class="flex1 text_pole textarea_compact" title="Characters sorting order" data-i18n="[title]Characters sorting order"> | ||
| 5860 | <option data-field="search" data-order="desc" data-i18n="Search" hidden>Search</option> | 5861 | <option data-field="search" data-order="desc" data-i18n="Search" hidden>Search</option> |
| 5861 | <option data-field="name" data-order="asc" data-i18n="A-Z">A-Z</option> | 5862 | <option data-field="name" data-order="asc" data-i18n="A-Z">A-Z</option> |
| 5862 | <option data-field="name" data-order="desc" data-i18n="Z-A">Z-A</option> | 5863 | <option data-field="name" data-order="desc" data-i18n="Z-A">Z-A</option> |
| @@ -5870,12 +5871,15 @@ | |||
| 5870 | <option data-field="data_size" data-order="asc" data-i18n="Least tokens">Least tokens</option> | 5871 | <option data-field="data_size" data-order="asc" data-i18n="Least tokens">Least tokens</option> |
| 5871 | <option data-field="name" data-order="random" data-i18n="Random">Random</option> | 5872 | <option data-field="name" data-order="random" data-i18n="Random">Random</option> |
| 5872 | </select> | 5873 | </select> |
| 5873 | </form> | 5874 | <div id="rm_button_search" class="right_menu_button fa-fw fa-solid fa-search" title="Toggle search bar" data-i18n="[title]Toggle search bar"></div> |
| 5875 | </div> | ||
| 5876 | <div id="form_character_search_form"> | ||
| 5877 | <input id="character_search_bar" class="text_pole textarea_compact width100p" type="search" data-i18n="[placeholder]Search..." placeholder="Search..." /> | ||
| 5878 | </div> | ||
| 5874 | <div class="rm_tag_controls"> | 5879 | <div class="rm_tag_controls"> |
| 5875 | <div class="tags rm_tag_filter"></div> | 5880 | <div class="tags rm_tag_filter"></div> |
| 5876 | <div class="tags rm_tag_bogus_drilldown"></div> | 5881 | <div class="tags rm_tag_bogus_drilldown"></div> |
| 5877 | </div> | 5882 | </div> |
| 5878 | <hr> | ||
| 5879 | </div> | 5883 | </div> |
| 5880 | 5884 | ||
| 5881 | <div id="rm_print_characters_pagination"> | 5885 | <div id="rm_print_characters_pagination"> |
| @@ -9367,6 +9367,38 @@ API Settings: ${JSON.stringify(getSettingsContents[getSettingsContents.main_api | |||
| 9367 | }); | 9367 | }); |
| 9368 | } | 9368 | } |
| 9369 | 9369 | ||
| 9370 | function initCharacterSearch() { | ||
| 9371 | const debouncedCharacterSearch = debounce((searchQuery) => { | ||
| 9372 | entitiesFilter.setFilterData(FILTER_TYPES.SEARCH, searchQuery); | ||
| 9373 | }); | ||
| 9374 | |||
| 9375 | const searchForm = $('#form_character_search_form'); | ||
| 9376 | const searchInput = $('#character_search_bar'); | ||
| 9377 | const searchButton = $('#rm_button_search'); | ||
| 9378 | |||
| 9379 | const storageKey = 'characterSearchFormVisible'; | ||
| 9380 | |||
| 9381 | searchInput.on('input', function () { | ||
| 9382 | const searchQuery = String($(this).val()); | ||
| 9383 | debouncedCharacterSearch(searchQuery); | ||
| 9384 | }); | ||
| 9385 | |||
| 9386 | searchButton.on('click', function () { | ||
| 9387 | const newVisibility = !searchForm.is(':visible'); | ||
| 9388 | searchForm.toggle(newVisibility); | ||
| 9389 | searchButton.toggleClass('active', newVisibility); | ||
| 9390 | accountStorage.setItem(storageKey, String(newVisibility)); | ||
| 9391 | if (newVisibility) { | ||
| 9392 | searchInput.trigger('focus'); | ||
| 9393 | } | ||
| 9394 | }); | ||
| 9395 | |||
| 9396 | eventSource.on(event_types.APP_READY, () => { | ||
| 9397 | const isVisible = accountStorage.getItem(storageKey) === 'true'; | ||
| 9398 | searchForm.toggle(isVisible); | ||
| 9399 | searchButton.toggleClass('active', isVisible); | ||
| 9400 | }); | ||
| 9401 | } | ||
| 9370 | 9402 | ||
| 9371 | // MARK: DOM Handlers Start | 9403 | // MARK: DOM Handlers Start |
| 9372 | jQuery(async function () { | 9404 | jQuery(async function () { |
| @@ -9417,13 +9449,7 @@ jQuery(async function () { | |||
| 9417 | $(document).on('click', '.last_mes .swipe_right', swipe_right); | 9449 | $(document).on('click', '.last_mes .swipe_right', swipe_right); |
| 9418 | $(document).on('click', '.last_mes .swipe_left', swipe_left); | 9450 | $(document).on('click', '.last_mes .swipe_left', swipe_left); |
| 9419 | 9451 | ||
| 9420 | const debouncedCharacterSearch = debounce((searchQuery) => { | 9452 | initCharacterSearch(); |
| 9421 | entitiesFilter.setFilterData(FILTER_TYPES.SEARCH, searchQuery); | ||
| 9422 | }); | ||
| 9423 | $('#character_search_bar').on('input', function () { | ||
| 9424 | const searchQuery = String($(this).val()); | ||
| 9425 | debouncedCharacterSearch(searchQuery); | ||
| 9426 | }); | ||
| 9427 | 9453 | ||
| 9428 | $('#mes_impersonate').on('click', function () { | 9454 | $('#mes_impersonate').on('click', function () { |
| 9429 | $('#option_impersonate').trigger('click'); | 9455 | $('#option_impersonate').trigger('click'); |
| @@ -2643,7 +2643,7 @@ input[type="file"] { | |||
| 2643 | align-items: center; | 2643 | align-items: center; |
| 2644 | flex-wrap: wrap; | 2644 | flex-wrap: wrap; |
| 2645 | gap: 10px; | 2645 | gap: 10px; |
| 2646 | padding: 0px 10px 0px 5px; | 2646 | padding-right: 5px; |
| 2647 | } | 2647 | } |
| 2648 | 2648 | ||
| 2649 | #chartokenwarning.menu_button { | 2649 | #chartokenwarning.menu_button { |
| @@ -2667,6 +2667,7 @@ input[type="file"] { | |||
| 2667 | transition: all var(--animation-duration-3x) ease-in-out; | 2667 | transition: all var(--animation-duration-3x) ease-in-out; |
| 2668 | } | 2668 | } |
| 2669 | 2669 | ||
| 2670 | .right_menu_button.active, | ||
| 2670 | .right_menu_button:hover { | 2671 | .right_menu_button:hover { |
| 2671 | filter: brightness(150%); | 2672 | filter: brightness(150%); |
| 2672 | } | 2673 | } |
| @@ -2771,6 +2772,11 @@ input[type="file"] { | |||
| 2771 | padding: 1px; | 2772 | padding: 1px; |
| 2772 | } | 2773 | } |
| 2773 | 2774 | ||
| 2775 | #rm_print_characters_pagination .menu_button { | ||
| 2776 | margin: 0; | ||
| 2777 | padding: 4px 5px; | ||
| 2778 | } | ||
| 2779 | |||
| 2774 | .bulk_select_checkbox { | 2780 | .bulk_select_checkbox { |
| 2775 | align-self: center; | 2781 | align-self: center; |
| 2776 | } | 2782 | } |
| @@ -2822,6 +2828,22 @@ input[type="file"] { | |||
| 2822 | overflow-y: auto; | 2828 | overflow-y: auto; |
| 2823 | } | 2829 | } |
| 2824 | 2830 | ||
| 2831 | #rm_button_bar { | ||
| 2832 | display: flex; | ||
| 2833 | gap: 5px; | ||
| 2834 | align-items: center; | ||
| 2835 | } | ||
| 2836 | |||
| 2837 | #rm_button_bar .menu_button { | ||
| 2838 | width: calc(var(--mainFontSize) * 1.8); | ||
| 2839 | aspect-ratio: 1; | ||
| 2840 | margin: 0; | ||
| 2841 | } | ||
| 2842 | |||
| 2843 | #rm_buttons_container { | ||
| 2844 | display: contents; | ||
| 2845 | } | ||
| 2846 | |||
| 2825 | #floatingPrompt, | 2847 | #floatingPrompt, |
| 2826 | #cfgConfig { | 2848 | #cfgConfig { |
| 2827 | overflow-y: auto; | 2849 | overflow-y: auto; |
| @@ -3060,15 +3082,17 @@ select option:not(:checked) { | |||
| 3060 | flex-grow: 1; | 3082 | flex-grow: 1; |
| 3061 | } | 3083 | } |
| 3062 | 3084 | ||
| 3085 | #charListFixedTop { | ||
| 3086 | padding: 1px; | ||
| 3087 | } | ||
| 3088 | |||
| 3063 | #form_character_search_form { | 3089 | #form_character_search_form { |
| 3064 | display: flex; | 3090 | display: flex; |
| 3065 | flex-direction: row; | 3091 | flex-direction: row; |
| 3066 | align-items: stretch; | 3092 | align-items: stretch; |
| 3067 | margin: 5px; | ||
| 3068 | column-gap: 5px; | 3093 | column-gap: 5px; |
| 3069 | } | 3094 | } |
| 3070 | 3095 | ||
| 3071 | #form_character_search_form .menu_button, | ||
| 3072 | #GroupFavDelOkBack .menu_button { | 3096 | #GroupFavDelOkBack .menu_button { |
| 3073 | margin: 0; | 3097 | margin: 0; |
| 3074 | height: fit-content; | 3098 | height: fit-content; |
| @@ -3078,17 +3102,20 @@ select option:not(:checked) { | |||
| 3078 | } | 3102 | } |
| 3079 | 3103 | ||
| 3080 | #character_sort_order { | 3104 | #character_sort_order { |
| 3081 | margin: 0; | ||
| 3082 | flex: 1; | 3105 | flex: 1; |
| 3083 | border-radius: 5px; | 3106 | border-radius: 5px; |
| 3084 | height: auto; | 3107 | margin: 0; |
| 3108 | padding: 4px 5px; | ||
| 3085 | } | 3109 | } |
| 3086 | 3110 | ||
| 3087 | #character_search_bar { | 3111 | #character_search_bar { |
| 3088 | margin: 0; | ||
| 3089 | flex: 1; | 3112 | flex: 1; |
| 3090 | /* padding-left: 0.75em; */ | 3113 | } |
| 3091 | height: auto; | 3114 | |
| 3115 | #rm_button_search { | ||
| 3116 | align-self: center; | ||
| 3117 | font-size: 1.1em; | ||
| 3118 | margin: 0 2px; | ||
| 3092 | } | 3119 | } |
| 3093 | 3120 | ||
| 3094 | #persona_search_bar { | 3121 | #persona_search_bar { |