mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
toggle for hiding WI Entry memo input box
This commit is contained in:
@ -2839,7 +2839,7 @@
|
||||
</div>
|
||||
<div class="inline-drawer-content flex-container">
|
||||
<div class="WIEntryContentAndMemo flex-container">
|
||||
<div class="world_entry_thin_controls">
|
||||
<div class="world_entry_thin_controls flex2">
|
||||
<div class="world_entry_form_control">
|
||||
<label for="content ">
|
||||
<small>
|
||||
@ -2856,7 +2856,7 @@
|
||||
<textarea class="text_pole" name="content" rows="4" placeholder="What this keyword should mean to the AI, sent verbatim"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="world_entry_thin_controls">
|
||||
<div class="world_entry_thin_controls commentContainer">
|
||||
<div class="world_entry_form_control">
|
||||
<label for="comment">
|
||||
<small>
|
||||
@ -2876,14 +2876,19 @@
|
||||
</div>
|
||||
<div name="WIEntryBottomControls" class="flex-container flex1 justifySpaceBetween world_entry_form_horizontal">
|
||||
<div class="flex-container flexFlowColumn flexNoGap wi-enter-footer-text ">
|
||||
<label class="checkbox">
|
||||
<label class="checkbox flex-container">
|
||||
<input type="checkbox" name="constant" />
|
||||
<span data-i18n="Constant">Constant</span>
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<label class="checkbox flex-container">
|
||||
<input type="checkbox" name="selective" />
|
||||
<span data-i18n="Selective">Selective</span>
|
||||
</label>
|
||||
<label class="checkbox flex-container">
|
||||
<input type="checkbox" name="addMemo">
|
||||
<span data-i18n="Add Memo">Add Memo</span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div class="world_entry_form_control world_entry_form_radios wi-enter-footer-text ">
|
||||
<div>
|
||||
@ -2896,6 +2901,7 @@
|
||||
<span data-i18n="After Char">After Char</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="world_entry_form_control wi-enter-footer-text flex-container flexNoGap ">
|
||||
Insertion Order
|
||||
|
@ -204,6 +204,7 @@ function appendWorldEntry(entry) {
|
||||
|
||||
// comment
|
||||
const commentInput = template.find('textarea[name="comment"]');
|
||||
const commentToggle = template.find('input[name="addMemo"]');
|
||||
commentInput.data("uid", entry.uid);
|
||||
commentInput.on("input", function () {
|
||||
const uid = $(this).data("uid");
|
||||
@ -211,8 +212,24 @@ function appendWorldEntry(entry) {
|
||||
world_info_data.entries[uid].comment = value;
|
||||
saveWorldInfo();
|
||||
});
|
||||
commentToggle.data("uid", entry.uid);
|
||||
commentToggle.on("input", function () {
|
||||
const uid = $(this).data("uid");
|
||||
const value = $(this).prop("checked");
|
||||
console.log(value)
|
||||
const commentContainer = $(this)
|
||||
.closest(".world_entry")
|
||||
.find(".commentContainer");
|
||||
world_info_data.entries[uid].addMemo = value;
|
||||
saveWorldInfo();
|
||||
value ? commentContainer.show() : commentContainer.hide();
|
||||
});
|
||||
|
||||
commentInput.val(entry.comment).trigger("input");
|
||||
//initScrollHeight(commentInput);
|
||||
commentToggle.prop("checked", entry.selective).trigger("input");
|
||||
commentToggle.siblings(".checkbox_fancy").click(function () {
|
||||
$(this).siblings("input").click();
|
||||
});
|
||||
|
||||
// content
|
||||
const countTokensDebounced = debounce(function (that, value) {
|
||||
@ -377,6 +394,7 @@ function createWorldInfoEntry() {
|
||||
content: "",
|
||||
constant: false,
|
||||
selective: false,
|
||||
addMemo: false,
|
||||
order: 100,
|
||||
position: 0,
|
||||
disable: false,
|
||||
|
@ -1899,9 +1899,10 @@ input[type=search]:focus::-webkit-search-cancel-button {
|
||||
}
|
||||
|
||||
.WIEntryContentAndMemo .world_entry_thin_controls {
|
||||
width: 50%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
#world_popup_name_button {
|
||||
display: none;
|
||||
}
|
||||
@ -3863,7 +3864,7 @@ toolcool-color-picker {
|
||||
}
|
||||
|
||||
.flex2 {
|
||||
flex: 2;
|
||||
flex: 2 !important;
|
||||
}
|
||||
|
||||
.flexFlowColumn {
|
||||
|
Reference in New Issue
Block a user