streamline WI display

This commit is contained in:
RossAscends 2023-09-25 18:03:10 +09:00
parent 86e9974410
commit e2d4f9dc8c
4 changed files with 64 additions and 36 deletions

View File

@ -70,6 +70,10 @@
} }
.world_entry_form_control {
width: 100%;
}
.drawer-content { .drawer-content {
min-width: unset; min-width: unset;
width: 100%; width: 100%;

View File

@ -147,6 +147,10 @@
font-weight: 600; font-weight: 600;
} }
.textAlignCenter {
text-align: center;
}
.margin-right-10px { .margin-right-10px {
margin-right: 10px; margin-right: 10px;
} }

View File

@ -3852,30 +3852,23 @@
<div id="entry_edit_template" class="template_element"> <div id="entry_edit_template" class="template_element">
<div class="world_entry"> <div class="world_entry">
<form class="world_entry_form"> <form class="world_entry_form">
<div class="inline-drawer wide100p"> <div class="inline-drawer wide100p">
<div class="inline-drawer-toggle inline-drawer-header gap5px"> <div class="inline-drawer-toggle inline-drawer-header gap5px">
<span class="drag-handle">&#9776;</span> <span class="drag-handle">&#9776;</span>
<div class="gap5px world_entry_thin_controls wide100p"> <div class="gap5px world_entry_thin_controls wide100p alignitemscenter">
<small>
<span><span class="world_entry_form_position_value"></span>
</span>
</small>
<div class="world_entry_form_control flex1"> <div class="world_entry_form_control flex1">
<label for="key"> <small class="displayNone">
<small> <span data-i18n="Comma separated (required)">
<span data-i18n="Keywords"> Comma separated (required)
Keywords </span>
</span> </small>
<span>(UID:&nbsp;
<span class="world_entry_form_uid_value"></span>
)
</span>
</small>
<small class="displayNone">
<span data-i18n="Comma separated (required)">
Comma separated (required)
</span>
</small>
</label>
<textarea class="text_pole keyprimarytextpole" name="key" rows="1" data-i18n="[placeholder]Comma separated (required)" placeholder="Comma separated (required)" maxlength="1000"></textarea> <textarea class="text_pole keyprimarytextpole" name="key" rows="1" data-i18n="[placeholder]Comma separated (required)" placeholder="Comma separated (required)" maxlength="1000"></textarea>
</div> </div>
<div class="flex-container widthFitContent alignItemsFlexEnd"> <div class="flex-container widthFitContent alignItemsFlexEnd">
@ -3886,19 +3879,15 @@
</div> </div>
<div class="world_entry_form_control keysecondary flex1"> <div class="world_entry_form_control keysecondary flex1">
<label for="keysecondary"> <small class="displayNone">
<small> <span data-i18n="(ignored if empty)">
<span data-i18n="Secondary Required Keywords"> (ignored if empty)
Optional Filter </span>
</span> </small>
</small> <div class="flex-container flexFlowRow">
<small class="displayNone"> <textarea class="text_pole keysecondarytextpole" name="keysecondary" rows="1" data-i18n="[placeholder]Comma separated (ignored if empty)" placeholder="Comma separated (ignored if empty)" maxlength="1000"></textarea>
<span data-i18n="Comma seperated (ignored if empty)"> <i class="menu_button delete_entry_button fa-solid fa-trash-can" type="submit" data-i18n="" value="" /></i>
Comma seperated (ignored if empty) </div>
</span>
</small>
</label>
<textarea class="text_pole keysecondarytextpole" name="keysecondary" rows="1" data-i18n="[placeholder]Comma separated (ignored if empty)" placeholder="Comma separated (ignored if empty)" maxlength="1000"></textarea>
</div> </div>
</div> </div>
<div class="fa-fw fa-solid fa-circle-chevron-down inline-drawer-icon down"></div> <div class="fa-fw fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
@ -3912,6 +3901,7 @@
<span data-i18n="Content"> <span data-i18n="Content">
Content Content
<span>(Tokens:&nbsp; <span class="world_entry_form_token_counter" data-first-run="true">counting...</span>) <span>(Tokens:&nbsp; <span class="world_entry_form_token_counter" data-first-run="true">counting...</span>)
<span class="world_entry_form_uid_value" data-first-run="true"></span>
</span> </span>
</span> </span>
</small> </small>
@ -4033,7 +4023,6 @@
<input class="text_pole wideMax100px margin0" type="number" name="probability" placeholder="" min="0" max="100" /> <input class="text_pole wideMax100px margin0" type="number" name="probability" placeholder="" min="0" max="100" />
</div> </div>
<input class="menu_button delete_entry_button" type="submit" data-i18n="Delete Entry" value="Delete Entry" />
</div> </div>
<div class="wide100p"> <div class="wide100p">
<hr> <hr>

View File

@ -288,7 +288,17 @@ function displayWorldEntries(name, data, navigation = navigation_option.none) {
showNavigator: true, showNavigator: true,
callback: function (page) { callback: function (page) {
$("#world_popup_entries_list").empty(); $("#world_popup_entries_list").empty();
const keywordHeaders = `
<div class="flex-container wide100p spaceBetween justifyCenter textAlignCenter">
<small class="flex1">
Keywords
</small>
<small class="flex1">
Optional Filter
</small>
</div>`
const blocks = page.map(entry => getWorldEntry(name, data, entry)); const blocks = page.map(entry => getWorldEntry(name, data, entry));
$("#world_popup_entries_list").append(keywordHeaders);
$("#world_popup_entries_list").append(blocks); $("#world_popup_entries_list").append(blocks);
}, },
afterSizeSelectorChange: function (e) { afterSizeSelectorChange: function (e) {
@ -780,8 +790,29 @@ function getWorldEntry(name, data, entry) {
.prop("selected", true) .prop("selected", true)
.trigger("input"); .trigger("input");
// display uid // display position/order info left of keyword box
template.find(".world_entry_form_uid_value").text(entry.uid); let posText
switch (entry.position) {
case 0:
posText = '↑CD';
break
case 1:
posText = 'CD↓';
break
case 2:
posText = '↑AN';
break
case 3:
posText = 'AN↓';
break
case 4:
posText = `@D${entry.depth}`;
break
}
template.find(".world_entry_form_position_value").text(`(${posText} ${entry.order})`);
//add UID above content box (less important doesn't need to be always visible)
template.find(".world_entry_form_uid_value").text(`(UID: ${entry.uid})`);
// disable // disable
const disableInput = template.find('input[name="disable"]'); const disableInput = template.find('input[name="disable"]');
@ -808,7 +839,7 @@ function getWorldEntry(name, data, entry) {
excludeRecursionInput.prop("checked", entry.excludeRecursion).trigger("input"); excludeRecursionInput.prop("checked", entry.excludeRecursion).trigger("input");
// delete button // delete button
const deleteButton = template.find("input.delete_entry_button"); const deleteButton = template.find(".delete_entry_button");
deleteButton.data("uid", entry.uid); deleteButton.data("uid", entry.uid);
deleteButton.on("click", function () { deleteButton.on("click", function () {
const uid = $(this).data("uid"); const uid = $(this).data("uid");