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>
|
||||||
<div class="inline-drawer-content flex-container">
|
<div class="inline-drawer-content flex-container">
|
||||||
<div class="WIEntryContentAndMemo 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">
|
<div class="world_entry_form_control">
|
||||||
<label for="content ">
|
<label for="content ">
|
||||||
<small>
|
<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>
|
<textarea class="text_pole" name="content" rows="4" placeholder="What this keyword should mean to the AI, sent verbatim"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="world_entry_thin_controls">
|
<div class="world_entry_thin_controls commentContainer">
|
||||||
<div class="world_entry_form_control">
|
<div class="world_entry_form_control">
|
||||||
<label for="comment">
|
<label for="comment">
|
||||||
<small>
|
<small>
|
||||||
@ -2876,14 +2876,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<div name="WIEntryBottomControls" class="flex-container flex1 justifySpaceBetween world_entry_form_horizontal">
|
<div name="WIEntryBottomControls" class="flex-container flex1 justifySpaceBetween world_entry_form_horizontal">
|
||||||
<div class="flex-container flexFlowColumn flexNoGap wi-enter-footer-text ">
|
<div class="flex-container flexFlowColumn flexNoGap wi-enter-footer-text ">
|
||||||
<label class="checkbox">
|
<label class="checkbox flex-container">
|
||||||
<input type="checkbox" name="constant" />
|
<input type="checkbox" name="constant" />
|
||||||
<span data-i18n="Constant">Constant</span>
|
<span data-i18n="Constant">Constant</span>
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox">
|
<label class="checkbox flex-container">
|
||||||
<input type="checkbox" name="selective" />
|
<input type="checkbox" name="selective" />
|
||||||
<span data-i18n="Selective">Selective</span>
|
<span data-i18n="Selective">Selective</span>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="checkbox flex-container">
|
||||||
|
<input type="checkbox" name="addMemo">
|
||||||
|
<span data-i18n="Add Memo">Add Memo</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="world_entry_form_control world_entry_form_radios wi-enter-footer-text ">
|
<div class="world_entry_form_control world_entry_form_radios wi-enter-footer-text ">
|
||||||
<div>
|
<div>
|
||||||
@ -2896,6 +2901,7 @@
|
|||||||
<span data-i18n="After Char">After Char</span>
|
<span data-i18n="After Char">After Char</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="world_entry_form_control wi-enter-footer-text flex-container flexNoGap ">
|
<div class="world_entry_form_control wi-enter-footer-text flex-container flexNoGap ">
|
||||||
Insertion Order
|
Insertion Order
|
||||||
|
@ -204,6 +204,7 @@ function appendWorldEntry(entry) {
|
|||||||
|
|
||||||
// comment
|
// comment
|
||||||
const commentInput = template.find('textarea[name="comment"]');
|
const commentInput = template.find('textarea[name="comment"]');
|
||||||
|
const commentToggle = template.find('input[name="addMemo"]');
|
||||||
commentInput.data("uid", entry.uid);
|
commentInput.data("uid", entry.uid);
|
||||||
commentInput.on("input", function () {
|
commentInput.on("input", function () {
|
||||||
const uid = $(this).data("uid");
|
const uid = $(this).data("uid");
|
||||||
@ -211,8 +212,24 @@ function appendWorldEntry(entry) {
|
|||||||
world_info_data.entries[uid].comment = value;
|
world_info_data.entries[uid].comment = value;
|
||||||
saveWorldInfo();
|
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");
|
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
|
// content
|
||||||
const countTokensDebounced = debounce(function (that, value) {
|
const countTokensDebounced = debounce(function (that, value) {
|
||||||
@ -377,6 +394,7 @@ function createWorldInfoEntry() {
|
|||||||
content: "",
|
content: "",
|
||||||
constant: false,
|
constant: false,
|
||||||
selective: false,
|
selective: false,
|
||||||
|
addMemo: false,
|
||||||
order: 100,
|
order: 100,
|
||||||
position: 0,
|
position: 0,
|
||||||
disable: false,
|
disable: false,
|
||||||
|
@ -1899,9 +1899,10 @@ input[type=search]:focus::-webkit-search-cancel-button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.WIEntryContentAndMemo .world_entry_thin_controls {
|
.WIEntryContentAndMemo .world_entry_thin_controls {
|
||||||
width: 50%;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#world_popup_name_button {
|
#world_popup_name_button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -3863,7 +3864,7 @@ toolcool-color-picker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.flex2 {
|
.flex2 {
|
||||||
flex: 2;
|
flex: 2 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flexFlowColumn {
|
.flexFlowColumn {
|
||||||
|
Reference in New Issue
Block a user