mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Pure CSS sorting by name
This commit is contained in:
@ -58,7 +58,7 @@
|
|||||||
<div id="leftNavDrawerIcon" class="drawer-icon icon-sliders closedIcon" title="AI Response Configuration"></div>
|
<div id="leftNavDrawerIcon" class="drawer-icon icon-sliders closedIcon" title="AI Response Configuration"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="left-nav-panel" class="drawer-content fillLeft closedDrawer widthFreeExpand">
|
<div id="left-nav-panel" class="drawer-content fillLeft closedDrawer widthFreeExpand">
|
||||||
<div class="right_menu_button" id="lm_button_panel_pin_div" title="Locked = Character Management panel will stay open">
|
<div class="right_menu_button" id="lm_button_panel_pin_div" title="Locked = AI Configuration panel will stay open">
|
||||||
<input type="checkbox" id="lm_button_panel_pin">
|
<input type="checkbox" id="lm_button_panel_pin">
|
||||||
<label for="lm_button_panel_pin">
|
<label for="lm_button_panel_pin">
|
||||||
<img class="unchecked svg_icon" alt="" src="img/lock-open-solid.svg" />
|
<img class="unchecked svg_icon" alt="" src="img/lock-open-solid.svg" />
|
||||||
|
@ -604,6 +604,7 @@ function printCharacters() {
|
|||||||
);
|
);
|
||||||
//console.log('printcharacters() -- printing -- ChID '+i+' ('+item.name+')');
|
//console.log('printcharacters() -- printing -- ChID '+i+' ('+item.name+')');
|
||||||
});
|
});
|
||||||
|
sortCharactersList('name', 'asc');
|
||||||
printGroups();
|
printGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3052,6 +3053,14 @@ function setGenerationProgress(progress) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sortCharactersList(field, order) {
|
||||||
|
let orderedList = characters.slice().sort((a, b) => order == 'asc' ? a[field].localeCompare(b[field]) : b[field].localeCompare(a[field]));
|
||||||
|
|
||||||
|
for (let i = 0; i < characters.length; i++) {
|
||||||
|
$(`.character_select[chid="${i}"]`).css({ 'order': orderedList.indexOf(characters[i]) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
window["TavernAI"].getContext = function () {
|
window["TavernAI"].getContext = function () {
|
||||||
return {
|
return {
|
||||||
chat: chat,
|
chat: chat,
|
||||||
|
@ -717,6 +717,8 @@ input[type="file"] {
|
|||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
#rm_ch_create_block {
|
#rm_ch_create_block {
|
||||||
|
Reference in New Issue
Block a user